public final class Hex
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
dump(byte[] arr,
int offset,
int length,
int outOffset,
int bpl,
int addressLength)
Formats a hex dump of a portion of a
byte[]. |
static java.lang.String |
s1(int v)
Formats an
int as a 1-byte signed hex value. |
static java.lang.String |
s2(int v)
Formats an
int as a 2-byte signed hex value. |
static java.lang.String |
s4(int v)
Formats an
int as a 4-byte signed hex value. |
static java.lang.String |
s8(long v)
Formats a
long as an 8-byte signed hex value. |
static java.lang.String |
u1(int v)
Formats an
int as a 1-byte unsigned hex value. |
static java.lang.String |
u2(int v)
Formats an
int as a 2-byte unsigned hex value. |
static java.lang.String |
u2or4(int v)
Formats an
int as either a 2-byte unsigned hex value
(if the value is small enough) or a 4-byte unsigned hex value (if
not). |
static java.lang.String |
u3(int v)
Formats an
int as a 3-byte unsigned hex value. |
static java.lang.String |
u4(int v)
Formats an
int as a 4-byte unsigned hex value. |
static java.lang.String |
u8(long v)
Formats a
long as an 8-byte unsigned hex value. |
static java.lang.String |
uNibble(int v)
Formats an
int as a 4-bit unsigned hex nibble. |
public static java.lang.String u8(long v)
long as an 8-byte unsigned hex value.v - value to formatnon-null; formatted formpublic static java.lang.String u4(int v)
int as a 4-byte unsigned hex value.v - value to formatnon-null; formatted formpublic static java.lang.String u3(int v)
int as a 3-byte unsigned hex value.v - value to formatnon-null; formatted formpublic static java.lang.String u2(int v)
int as a 2-byte unsigned hex value.v - value to formatnon-null; formatted formpublic static java.lang.String u2or4(int v)
int as either a 2-byte unsigned hex value
(if the value is small enough) or a 4-byte unsigned hex value (if
not).v - value to formatnon-null; formatted formpublic static java.lang.String u1(int v)
int as a 1-byte unsigned hex value.v - value to formatnon-null; formatted formpublic static java.lang.String uNibble(int v)
int as a 4-bit unsigned hex nibble.v - value to formatnon-null; formatted formpublic static java.lang.String s8(long v)
long as an 8-byte signed hex value.v - value to formatnon-null; formatted formpublic static java.lang.String s4(int v)
int as a 4-byte signed hex value.v - value to formatnon-null; formatted formpublic static java.lang.String s2(int v)
int as a 2-byte signed hex value.v - value to formatnon-null; formatted formpublic static java.lang.String s1(int v)
int as a 1-byte signed hex value.v - value to formatnon-null; formatted formpublic static java.lang.String dump(byte[] arr,
int offset,
int length,
int outOffset,
int bpl,
int addressLength)
byte[]. The result
is always newline-terminated, unless the passed-in length was zero,
in which case the result is always the empty string ("").arr - non-null; array to formatoffset - >= 0; offset to the part to dumplength - >= 0; number of bytes to dumpoutOffset - >= 0; first output offset to printbpl - >= 0; number of bytes of output per lineaddressLength - {2,4,6,8}; number of characters for each address
headernon-null; a string of the dumpCopyright © 2020. All Rights Reserved.