public final class Hex
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static char[] |
HEX_CHAR
Used to build output as Hex
|
private static byte[] |
HEX_VALUE
<hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]
|
| Modifier | Constructor and Description |
|---|---|
private |
Hex() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
convertEscapedHex(java.lang.String str)
Convert an escaoed list of bytes to a byte[]
|
static java.lang.String |
decodeHexString(java.lang.String str)
Decodes values of attributes in the DN encoded in hex into a UTF-8
String.
|
static char[] |
encodeHex(byte[] data)
Converts an array of bytes into an array of characters representing the
hexadecimal values of each byte in order.
|
static byte |
getHexValue(byte high,
byte low)
Translate two bytes to an hex value.
|
static byte |
getHexValue(char c)
Return an hex value from a single char
The char must be in [0-9a-fA-F]
|
static byte |
getHexValue(char high,
char low)
Translate two chars to an hex value.
|
private static final byte[] HEX_VALUE
private static final char[] HEX_CHAR
public static byte getHexValue(char high,
char low)
high - The high valuelow - The low valuepublic static byte getHexValue(byte high,
byte low)
high - The high valuelow - The low valuepublic static byte getHexValue(char c)
c - The char we want to convertpublic static java.lang.String decodeHexString(java.lang.String str)
throws javax.naming.InvalidNameException
str - the string to decodejavax.naming.InvalidNameExceptionpublic static byte[] convertEscapedHex(java.lang.String str)
throws javax.naming.InvalidNameException
str - the string containing hex escapesjavax.naming.InvalidNameExceptionpublic static char[] encodeHex(byte[] data)
data - a byte[] to convert to Hex characters