public class Hex extends Object
Constructor and Description |
---|
Hex() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decodeHex(String str)
Converts an array of characters representing hexidecimal values into an
array of bytes of those same values.
|
static String |
encodeHex(byte[] data)
Converts an array of bytes into an array of characters representing the hexidecimal values of each byte in order.
|
protected static int |
toDigit(char ch,
int index)
Converts a hexadecimal character to an integer.
|
public static byte[] decodeHex(String str)
str
- An array of characters containing hexidecimal digitsRuntimeException
- Thrown if an odd number or illegal of characters
is suppliedprotected static int toDigit(char ch, int index)
ch
- A character to convert to an integer digitindex
- The index of the character in the sourcepublic static String encodeHex(byte[] data)
data
- a byte[] to convert to Hex charactersCopyright © 2019 JBoss by Red Hat. All rights reserved.