public final class Hex extends Object
#DEFAULT_CHARSET_NAME
This class is thread-safe.| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decode(char[] data)
Converts an array of characters representing hexadecimal values into an array of bytes of those same values.
|
static byte[] |
decode(String data) |
static char[] |
encode(byte[] data)
Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
|
static char[] |
encode(byte[] data,
boolean toLowerCase)
Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
|
static String |
encodeToString(byte[] data)
Converts an array of bytes into a String representing the hexadecimal values of each byte in order.
|
static String |
encodeToString(byte[] data,
boolean toLowerCase)
Converts an array of bytes into a String representing the hexadecimal values of each byte in order.
|
public static char[] encode(byte[] data)
data - a byte[] to convert to Hex characterspublic static char[] encode(byte[] data,
boolean toLowerCase)
data - a byte[] to convert to Hex characterstoLowerCase - true converts to lowercase, false to uppercasepublic static String encodeToString(byte[] data)
data - a byte[] to convert to Hex characterspublic static String encodeToString(byte[] data, boolean toLowerCase)
data - a byte[] to convert to Hex characterstoLowerCase - true converts to lowercase, false to uppercasepublic static byte[] decode(String data) throws IllegalArgumentException
data - IllegalArgumentException - the illegal argument exceptionpublic static byte[] decode(char[] data)
throws IllegalArgumentException
IllegalArgumentException - the illegal argument exceptionCopyright © 2021. All rights reserved.