Class HexCharset.Decoder

java.lang.Object
java.nio.charset.CharsetDecoder
org.red5.io.utils.HexCharset.Decoder
Enclosing class:
HexCharset

private class HexCharset.Decoder extends CharsetDecoder
  • Field Details

    • charCount

      private int charCount
  • Constructor Details

    • Decoder

      private Decoder()
  • Method Details

    • decodeLoop

      public CoderResult decodeLoop(ByteBuffer in, CharBuffer out)
      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 most out.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 the decode method. Most implementations of this method will handle decoding errors by returning an appropriate result object for interpretation by the decode 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 class CharsetDecoder
      Parameters:
      in - The input byte buffer
      out - 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 class CharsetDecoder