org.castor.util
Class HexDecoder
java.lang.Object
org.castor.util.HexDecoder
public final class HexDecoder
extends java.lang.Object
Hex encoder/decoder implementation (borrowed from BouncyCastle=.
static byte[] | decode(String data) - Decodes the HEX input data producing a output stream.
|
static int | decode(String data, OutputStream out) - Decodes the Hex encoded String data writing it to the given output stream,
whitespace characters will be ignored.
|
static int | decode(byte[] data, int off, int length, OutputStream out) - Decodes the Hex encoded byte data writing it to the given output stream,
whitespace characters will be ignored.
|
static String | encode(byte[] data) - Encodes the input data producing a Hex output stream.
|
static int | encode(byte[] data, int off, int length, OutputStream out) - Encodes the input data producing a Hex output stream.
|
protected static void | initialiseDecodingTable() - Initialize the decoding table.
|
DATA_TYPE
public static final String DATA_TYPE
Identifies the data type supported by this decoder.
DECODING_TABLE
protected static final byte[] DECODING_TABLE
Decoding table.
ENCODING_TABLE
protected static final byte[] ENCODING_TABLE
Encoding table.
decode
public static byte[] decode(String data)
Decodes the HEX input data producing a output stream.
data
- Input data to be decoded.
- A byte array representing the decoded input data.
decode
public static int decode(String data,
OutputStream out)
throws IOException
Decodes the Hex encoded String data writing it to the given output stream,
whitespace characters will be ignored.
data
- The data to be encodedout
- The OutputStream
instance
- the number of bytes produced.
decode
public static int decode(byte[] data,
int off,
int length,
OutputStream out)
throws IOException
Decodes the Hex encoded byte data writing it to the given output stream,
whitespace characters will be ignored.
data
- The data to be encodedoff
- Initial offset.length
- Initial lengthout
- The OutputStream
instance
- the number of bytes produced.
encode
public static String encode(byte[] data)
Encodes the input data producing a Hex output stream.
data
- Input data to encode.
- the number of bytes produced.
encode
public static int encode(byte[] data,
int off,
int length,
OutputStream out)
throws IOException
Encodes the input data producing a Hex output stream.
data
- The input data to be HEX encodedoff
- Initiak offsetlength
- Initial length of the input data arrayout
- The OutputStream
instance holding the encoded input data.
- the number of bytes produced.
initialiseDecodingTable
protected static void initialiseDecodingTable()
Initialize the decoding table.
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com