Package org.bouncycastle.util.encoders
Class HexEncoder
java.lang.Object
org.bouncycastle.util.encoders.HexEncoder
- All Implemented Interfaces:
Encoder
public class HexEncoder extends Object implements Encoder
-
Field Summary
Fields Modifier and Type Field Description protected byte[]decodingTableprotected byte[]encodingTable -
Constructor Summary
Constructors Constructor Description HexEncoder() -
Method Summary
Modifier and Type Method Description 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 Details
-
encodingTable
protected final byte[] encodingTable -
decodingTable
protected final byte[] decodingTable
-
-
Constructor Details
-
HexEncoder
public HexEncoder()
-
-
Method Details
-
initialiseDecodingTable
protected void initialiseDecodingTable() -
encode
encode the input data producing a Hex output stream.- Specified by:
encodein interfaceEncoder- Returns:
- the number of bytes produced.
- Throws:
IOException
-
decode
decode the Hex encoded byte data writing it to the given output stream, whitespace characters will be ignored.- Specified by:
decodein interfaceEncoder- Returns:
- the number of bytes produced.
- Throws:
IOException
-
decode
decode the Hex encoded String data writing it to the given output stream, whitespace characters will be ignored.- Specified by:
decodein interfaceEncoder- Returns:
- the number of bytes produced.
- Throws:
IOException
-