|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.api.util.Hex
public class Hex
Various hex and string manipulation methods that are more efficient then chaining operations: all is done in the same buffer without creating a bunch of intermediate String objects.
| Field Summary | |
|---|---|
static char[] |
HEX_CHAR
Used to build output as Hex |
static byte[] |
HEX_VALUE
<hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66] |
| Constructor Summary | |
|---|---|
Hex()
|
|
| Method Summary | |
|---|---|
static byte[] |
convertEscapedHex(String str)
Convert an escaoed list of bytes to a byte[] |
static String |
decodeHexString(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 hexidecimal 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 sinle char The char must be in [0-9a-fA-F] |
static byte |
getHexValue(char high,
char low)
Translate two chars to an hex value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte[] HEX_VALUE
public static final char[] HEX_CHAR
| Constructor Detail |
|---|
public Hex()
| Method Detail |
|---|
public static byte getHexValue(char high,
char low)
high - The high valuelow - The low value
public static byte getHexValue(byte high,
byte low)
high - The high valuelow - The low value
public static byte getHexValue(char c)
c - The char we want to convert
public static String decodeHexString(String str)
throws InvalidNameException
str - the string to decode
InvalidNameException
public static byte[] convertEscapedHex(String str)
throws InvalidNameException
str - the string containing hex escapes
InvalidNameExceptionpublic static char[] encodeHex(byte[] data)
data - a byte[] to convert to Hex characters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||