Class HexCharset.Decoder
- Enclosing class:
- HexCharset
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecodeLoop
(ByteBuffer in, CharBuffer out) Decodes one or more bytes into one or more characters.protected void
Resets this decoder, clearing any charset-specific internal state.Methods inherited from class java.nio.charset.CharsetDecoder
averageCharsPerByte, charset, decode, decode, detectedCharset, flush, implFlush, implOnMalformedInput, implOnUnmappableCharacter, implReplaceWith, isAutoDetecting, isCharsetDetected, malformedInputAction, maxCharsPerByte, onMalformedInput, onUnmappableCharacter, replacement, replaceWith, reset, unmappableCharacterAction
-
Field Details
-
charCount
private int charCount
-
-
Constructor Details
-
Decoder
private Decoder()
-
-
Method Details
-
decodeLoop
Decodes one or more bytes into one or more characters.This method encapsulates the basic decoding loop, decoding as many bytes as possible until it either runs out of input, runs out of room in the output buffer, or encounters a decoding error. This method is invoked by the
decode
method, which handles result interpretation and error recovery.The buffers are read from, and written to, starting at their current positions. At most
in.remaining()
bytes will be read, and at mostout.remaining()
characters will be written. The buffers' positions will be advanced to reflect the bytes read and the characters written, but their marks and limits will not be modified.This method returns a
CoderResult
object to describe its reason for termination, in the same manner as thedecode
method. Most implementations of this method will handle decoding errors by returning an appropriate result object for interpretation by thedecode
method. An optimized implementation may instead examine the relevant error action and implement that action itself.An implementation of this method may perform arbitrary lookahead by returning
CoderResult.UNDERFLOW
until it receives sufficient input.- Specified by:
decodeLoop
in classCharsetDecoder
- Parameters:
in
- The input byte bufferout
- The output character buffer- Returns:
- A coder-result object describing the reason for termination
-
implReset
protected void implReset()Resets this decoder, clearing any charset-specific internal state.The default implementation of this method does nothing. This method should be overridden by decoders that maintain internal state.
- Overrides:
implReset
in classCharsetDecoder
-