Method Detail

decodeHex

Converts an array of characters representing hexadecimal values into an array of bytes of those same values. The
returned array will be half the length of the passed array, as it takes two characters to represent any given
byte. An exception is thrown if the passed char array has an odd number of elements.

encodeHex

Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
The returned array will be double the length of the passed array, as it takes two characters to represent any
given byte.

Parameters:

data - a byte[] to convert to Hex characters

Returns:

A char[] containing hexadecimal characters

encodeHex

Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
The returned array will be double the length of the passed array, as it takes two characters to represent any
given byte.

Parameters:

data - a byte[] to convert to Hex characters

toLowerCase - true converts to lowercase, false to uppercase

Returns:

A char[] containing hexadecimal characters

Since:

1.4

encodeHex

Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
The returned array will be double the length of the passed array, as it takes two characters to represent any
given byte.

Parameters:

data - a byte[] to convert to Hex characters

toDigits - the output alphabet

Returns:

A char[] containing hexadecimal characters

Since:

1.4

encodeHexString

Converts an array of bytes into a String representing the hexadecimal values of each byte in order. The returned
String will be double the length of the passed array, as it takes two characters to represent any given byte.

decode

Converts an array of character bytes representing hexadecimal values into an array of bytes of those same values.
The returned array will be half the length of the passed array, as it takes two characters to represent any given
byte. An exception is thrown if the passed char array has an odd number of elements.

decode

Converts a String or an array of character bytes representing hexadecimal values into an array of bytes of those
same values. The returned array will be half the length of the passed String or array, as it takes two characters
to represent any given byte. An exception is thrown if the passed char array has an odd number of elements.

encode

Converts an array of bytes into an array of bytes for the characters representing the hexadecimal values of each
byte in order. The returned array will be double the length of the passed array, as it takes two characters to
represent any given byte.

The conversion from hexadecimal characters to the returned bytes is performed with the charset named by
getCharset().

encode

Converts a String or an array of bytes into an array of characters representing the hexadecimal values of each
byte in order. The returned array will be double the length of the passed String or array, as it takes two
characters to represent any given byte.

The conversion from hexadecimal characters to bytes to be encoded to performed with the charset named by
getCharset().