java.lang.Object com.realtime.crossfire.jxclient.util.HexCodec
public class HexCodec
Utility class for en-/decoding hexadecimal strings.
Field Summary | |
---|---|
private static java.lang.CharSequence |
HEX_CHARS
Hex characters for values 0-15. |
Constructor Summary | |
---|---|
private |
HexCodec()
Private constructor to prevent instantiation. |
Method Summary | |
---|---|
static java.lang.String |
hexDump(byte[] data,
int start,
int end)
Returns a hex dump of a part of a byte array. |
static void |
hexEncode2(java.lang.StringBuilder sb,
int value)
Append a given value as a two digits hexadecimal number. |
private static void |
hexEncode4(java.lang.StringBuilder sb,
int value)
Append a given value as a four digits hexadecimal number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private static final java.lang.CharSequence HEX_CHARS
Constructor Detail |
---|
private HexCodec()
Method Detail |
---|
public static java.lang.String hexDump(@NotNull byte[] data, int start, int end)
data
- the byte array to dumpstart
- the starting indexend
- the end index
public static void hexEncode2(@NotNull java.lang.StringBuilder sb, int value)
sb
- the StringBuilder
to append tovalue
- the value to appendprivate static void hexEncode4(@NotNull java.lang.StringBuilder sb, int value)
sb
- the StringBuilder
to append tovalue
- the value to append