Class HexEncoder
-
- All Implemented Interfaces:
-
io.anyline.nfc.bouncycastle.util.encoders.Encoder
public class HexEncoder implements Encoder
A streaming Hex encoder.
-
-
Constructor Summary
Constructors Constructor Description HexEncoder()
-
Method Summary
Modifier and Type Method Description int
encode(Array<byte> inBuf, int inOff, int inLen, Array<byte> outBuf, int outOff)
int
getEncodedLength(int inputLength)
Return the expected output length of the encoding. int
getMaxDecodedLength(int inputLength)
Return the maximum expected output length of a decoding. int
encode(Array<byte> buf, int off, int len, OutputStream out)
encode the input data producing a Hex output stream. int
decode(Array<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. int
decode(String data, OutputStream out)
decode the Hex encoded String data writing it to the given output stream, whitespace characters will be ignored. -
-
Method Detail
-
getEncodedLength
int getEncodedLength(int inputLength)
Return the expected output length of the encoding.
- Parameters:
inputLength
- the input length of the data.- Returns:
the output length of an encoding.
-
getMaxDecodedLength
int getMaxDecodedLength(int inputLength)
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
- the input length of the encoded data.- Returns:
the upper bound of the output length of a decoding.
-
encode
int encode(Array<byte> buf, int off, int len, OutputStream out)
encode the input data producing a Hex output stream.
- Returns:
the number of bytes produced.
-
decode
int decode(Array<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
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.
-
-
-
-