| java.lang.Object com.lutris.util.HexEncoder
HexEncoder | public class HexEncoder (Code) | | 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.
author: Mike Ward |
Method Summary | |
final public static String | toHexString(long value, int len, char pad) Converts a long integer to an unsigned hexadecimal String. | final public static String | toHexString(byte[] bytes) Converts an arbitrary array of bytes to ASCII hexadecimal string
form, with two hex characters corresponding to each byte. |
toHexString | final public static String toHexString(long value, int len, char pad)(Code) | | 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.
Parameters: value - The long integer to convert to a hexadecimal string. Parameters: len - The total padded length of the string. If the numberis larger than the padded length, then this lengthof the string will be the length of the number. Parameters: pad - The character to use for padding. Unsigned hexadecimal numeric string representing the specified value. |
toHexString | final public static String toHexString(byte[] bytes)(Code) | | 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.
Parameters: bytes - The array of bytes to convert to ASCII hex form. An ASCII hexadecimal numeric string representing thespecified array of bytes. |
|
|