|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.commons.codec.binary.Hex
Hex encoder and decoder.
| Field Summary | |
private static char[] |
DIGITS
Used building output as Hex |
| Constructor Summary | |
Hex()
|
|
| Method Summary | |
byte[] |
decode(byte[] array)
Converts an array of character bytes representing hexidecimal values into an array of bytes of those same values. |
Object |
decode(Object object)
Converts a String or an array of character bytes representing hexidecimal values into an array of bytes of those same values. |
static byte[] |
decodeHex(char[] data)
Converts an array of characters representing hexidecimal values into an array of bytes of those same values. |
byte[] |
encode(byte[] array)
Converts an array of bytes into an array of bytes for the characters representing the hexidecimal values of each byte in order. |
Object |
encode(Object object)
Converts a String or an array of bytes into an array of characters representing the hexidecimal values of each byte in order. |
static char[] |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final char[] DIGITS
| Constructor Detail |
public Hex()
| Method Detail |
public static byte[] decodeHex(char[] data)
throws DecoderException
data - An array of characters containing hexidecimal digits
DecoderException - Thrown if an odd number or illegal of characters
is supplied
protected static int toDigit(char ch,
int index)
throws DecoderException
ch - A character to convert to an integer digitindex - The index of the character in the source
DecoderException - Thrown if ch is an illegal hex characterpublic static char[] encodeHex(byte[] data)
data - a byte[] to convert to Hex characters
public byte[] decode(byte[] array)
throws DecoderException
decode in interface BinaryDecoderarray - An array of character bytes containing hexidecimal digits
DecoderException - Thrown if an odd number of characters is supplied
to this functiondecodeHex(char[])
public Object decode(Object object)
throws DecoderException
decode in interface Decoderobject - A String or, an array of character bytes containing hexidecimal digits
DecoderException - Thrown if an odd number of characters is supplied
to this function or the object is not a String or char[]decodeHex(char[])public byte[] encode(byte[] array)
encode in interface BinaryEncoderarray - a byte[] to convert to Hex characters
encodeHex(byte[])
public Object encode(Object object)
throws EncoderException
encode in interface Encoderobject - a String, or byte[] to convert to Hex characters
EncoderException - Thrown if the given object is not a String or byte[]encodeHex(byte[])
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||