org.bouncycastle.util.encoders

Class HexEncoder

public class HexEncoder extends Object implements Encoder

Field Summary
protected byte[]decodingTable
protected byte[]encodingTable
Constructor Summary
HexEncoder()
Method Summary
intdecode(byte[] data, int off, int length, OutputStream out)
decode the Hex encoded byte data writing it to the given output stream, whitespace characters will be ignored.
intdecode(String data, OutputStream out)
decode the Hex encoded String data writing it to the given output stream, whitespace characters will be ignored.
intencode(byte[] data, int off, int length, OutputStream out)
encode the input data producing a Hex output stream.
protected voidinitialiseDecodingTable()

Field Detail

decodingTable

protected final byte[] decodingTable

encodingTable

protected final byte[] encodingTable

Constructor Detail

HexEncoder

public HexEncoder()

Method Detail

decode

public int decode(byte[] data, int off, int length, OutputStream out)
decode the Hex encoded byte data writing it to the given output stream, whitespace characters will be ignored.

Returns: the number of bytes produced.

decode

public int decode(String data, OutputStream out)
decode the Hex encoded String data writing it to the given output stream, whitespace characters will be ignored.

Returns: the number of bytes produced.

encode

public int encode(byte[] data, int off, int length, OutputStream out)
encode the input data producing a Hex output stream.

Returns: the number of bytes produced.

initialiseDecodingTable

protected void initialiseDecodingTable()