Package org.cryptacular.codec
Class HexDecoder
java.lang.Object
org.cryptacular.codec.HexDecoder
- All Implemented Interfaces:
Decoder
Stateful hexadecimal character-to-byte decoder.
- Author:
- Middleware Services
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(CharBuffer input, ByteBuffer output) Decodes characters in input buffer into bytes placed in the output buffer.voidfinalize(ByteBuffer output) Performs final output decoding (e.g. padding) after all input characters have been provided.intoutputSize(int inputSize) Expected number of bytes in the output buffer for an input buffer of the given size.
-
Constructor Details
-
HexDecoder
public HexDecoder()
-
-
Method Details
-
decode
Description copied from interface:DecoderDecodes characters in input buffer into bytes placed in the output buffer. This method may be called multiple times, followed byDecoder.finalize(ByteBuffer). after all input bytes have been provided.- Specified by:
decodein interfaceDecoder- Parameters:
input- Input character buffer.output- Output byte buffer.- Throws:
EncodingException- on decoding errors.
-
finalize
Description copied from interface:DecoderPerforms final output decoding (e.g. padding) after all input characters have been provided.- Specified by:
finalizein interfaceDecoder- Parameters:
output- Output byte buffer.- Throws:
EncodingException- on decoding errors.
-
outputSize
public int outputSize(int inputSize) Description copied from interface:DecoderExpected number of bytes in the output buffer for an input buffer of the given size.- Specified by:
outputSizein interfaceDecoder- Parameters:
inputSize- Size of input buffer in characters.- Returns:
- Minimum byte buffer size required to store all decoded characters in input buffer.
-