public class HexCodec
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.lang.CharSequence |
HEX_CHARS
Hex characters for values 0-15.
|
Modifier | Constructor and Description |
---|---|
private |
HexCodec()
Private constructor to prevent instantiation.
|
Modifier and Type | Method and Description |
---|---|
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.
|
@NotNull private static final java.lang.CharSequence HEX_CHARS
public static java.lang.String hexDump(@NotNull byte[] data, int start, int end)
data
- the byte array to dumpstart
- the starting indexend
- the end indexpublic 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