java.lang.Object
com.lutris.util.HexEncoder
- public class HexEncoder
- extends java.lang.Object
Various conversion methods.
These methods are mostly used to convert internal java data
fields into byte arrays or strings for use in 8 bit ASCII fields.
|
Field Summary |
private static char[] |
HexChars
Hexadecimal characters corresponding to each half byte value. |
|
Method Summary |
static java.lang.String |
toHexString(byte[] bytes)
Converts an arbitrary array of bytes to ASCII hexadecimal string
form, with two hex characters corresponding to each byte. |
static java.lang.String |
toHexString(long value,
int len,
char pad)
Converts a long integer to an unsigned hexadecimal String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HexChars
private static final char[] HexChars
- Hexadecimal characters corresponding to each half byte value.
HexEncoder
public HexEncoder()
toHexString
public static final java.lang.String toHexString(long value,
int len,
char pad)
- Converts a long integer to an unsigned hexadecimal String. Treats
the integer as an unsigned 64 bit value and left-pads with the
pad character of the caller's choice.
toHexString
public static final java.lang.String toHexString(byte[] bytes)
- Converts an arbitrary array of bytes to ASCII hexadecimal string
form, with two hex characters corresponding to each byte. The
length of the resultant string in characters will be twice the
length of the specified array of bytes.