Top Description Fields Constructors Methods
org.bouncycastle.util.encoders

public Class HexEncoder

extends Object
implements Encoder
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.encoders.Encoder
Imports
java.io.IOException, .OutputStream

A streaming Hex encoder.

Field Summary

Modifier and TypeField and Description
protected final byte[]
protected final byte[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of bytes produced.
decode
(byte[] data, int off, int length, OutputStream out)

Implements org.bouncycastle.util.encoders.Encoder.decode.

decode the Hex encoded byte data writing it to the given output stream, whitespace characters will be ignored.
public int

Returns:

the number of bytes produced.
decode
(String data, OutputStream out)

Implements org.bouncycastle.util.encoders.Encoder.decode.

decode the Hex encoded String data writing it to the given output stream, whitespace characters will be ignored.
pack-priv byte[]
decodeStrict(String str, int off, int len)

public int
encode(byte[] inBuf, int inOff, int inLen, byte[] outBuf, int outOff)

public int

Returns:

the number of bytes produced.
encode
(byte[] buf, int off, int len, OutputStream out)

Implements org.bouncycastle.util.encoders.Encoder.encode.

encode the input data producing a Hex output stream.
public int
getEncodedLength(int
the input length of the data.
inputLength
)

Implements org.bouncycastle.util.encoders.Encoder.getEncodedLength.

Return the expected output length of the encoding.
public int
getMaxDecodedLength(int
the input length of the encoded data.
inputLength
)

Implements org.bouncycastle.util.encoders.Encoder.getMaxDecodedLength.

Return the maximum expected output length of a decoding.
private static boolean
ignore(char c)

protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

decodingTableback to summary
protected final byte[] decodingTable
encodingTableback to summary
protected final byte[] encodingTable

Constructor Detail

HexEncoderback to summary
public HexEncoder()

Method Detail

decodeback to summary
public int decode(byte[] data, int off, int length, OutputStream out) throws IOException

Implements org.bouncycastle.util.encoders.Encoder.decode.

decode the Hex encoded byte data writing it to the given output stream, whitespace characters will be ignored.

Returns:int

the number of bytes produced.

decodeback to summary
public int decode(String data, OutputStream out) throws IOException

Implements org.bouncycastle.util.encoders.Encoder.decode.

decode the Hex encoded String data writing it to the given output stream, whitespace characters will be ignored.

Returns:int

the number of bytes produced.

decodeStrictback to summary
pack-priv byte[] decodeStrict(String str, int off, int len) throws IOException
encodeback to summary
public int encode(byte[] inBuf, int inOff, int inLen, byte[] outBuf, int outOff) throws IOException
encodeback to summary
public int encode(byte[] buf, int off, int len, OutputStream out) throws IOException

Implements org.bouncycastle.util.encoders.Encoder.encode.

encode the input data producing a Hex output stream.

Returns:int

the number of bytes produced.

getEncodedLengthback to summary
public int getEncodedLength(int inputLength)

Implements org.bouncycastle.util.encoders.Encoder.getEncodedLength.

Doc from org.bouncycastle.util.encoders.Encoder.getEncodedLength.

Return the expected output length of the encoding.

Parameters
inputLength:int

the input length of the data.

Returns:int

the output length of an encoding.

getMaxDecodedLengthback to summary
public int getMaxDecodedLength(int inputLength)

Implements org.bouncycastle.util.encoders.Encoder.getMaxDecodedLength.

Doc from org.bouncycastle.util.encoders.Encoder.getMaxDecodedLength.

Return the maximum expected output length of a decoding. If padding is present the value returned will be greater than the decoded data length.

Parameters
inputLength:int

the input length of the encoded data.

Returns:int

the upper bound of the output length of a decoding.

ignoreback to summary
private static boolean ignore(char c)
initialiseDecodingTableback to summary
protected void initialiseDecodingTable()