public class HexEncoding extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decode(char[] encoded,
boolean allowSingleChar)
Decodes the provided hexadecimal string into a byte array.
|
static char[] |
encode(byte[] data)
Encodes the provided data as a sequence of hexadecimal characters.
|
static char[] |
encode(byte[] data,
int offset,
int len)
Encodes the provided data as a sequence of hexadecimal characters.
|
public static char[] encode(byte[] data)
public static char[] encode(byte[] data,
int offset,
int len)
public static byte[] decode(char[] encoded,
boolean allowSingleChar)
throws IllegalArgumentException
allowSingleChar
is true odd-length inputs are allowed and the first character is interpreted
as the lower bits of the first result byte.
Throws an IllegalArgumentException if the input is malformed.IllegalArgumentException