public final class HexUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
hexBytesOfLong(long v)
Builds an hex
String that represents the provided long value. |
static long |
longOfHexBytes(java.lang.String str,
int offset)
Retrieves the
long value represented by the provided hex String . |
static <T extends java.lang.CharSequence> |
validateHexBytes(T str)
Checks that the provided
CharSequence is a valid hex CharSequence ,
throwing an IllegalArgumentException if it is not. |
public static <T extends java.lang.CharSequence> T validateHexBytes(T str)
CharSequence
is a valid hex CharSequence
,
throwing an IllegalArgumentException
if it is not.T
- The type of CharSequence
to validate.str
- the CharSequence
to check.CharSequence
unchanged.public static long longOfHexBytes(java.lang.String str, int offset)
long
value represented by the provided hex String
.
Throws StringIndexOutOfBoundsException
if offset is invalid.str
- an hex String
.offset
- The index to start within str
to start the conversion.long
value.public static java.lang.String hexBytesOfLong(long v)
String
that represents the provided long
value.v
- the long
value.String
.