Class CharsetStringBuilder.DecoderStringBuilder

java.lang.Object
org.eclipse.jetty.util.CharsetStringBuilder.DecoderStringBuilder
All Implemented Interfaces:
CharsetStringBuilder
Enclosing interface:
CharsetStringBuilder

public static class CharsetStringBuilder.DecoderStringBuilder extends Object implements CharsetStringBuilder
  • Constructor Details

    • DecoderStringBuilder

      public DecoderStringBuilder(CharsetDecoder charsetDecoder)
  • Method Details

    • append

      public void append(byte b)
      Specified by:
      append in interface CharsetStringBuilder
      Parameters:
      b - An encoded byte to append
    • append

      public void append(char c)
      Specified by:
      append in interface CharsetStringBuilder
      Parameters:
      c - A decoded character to append
    • append

      public void append(CharSequence chars, int offset, int length)
      Specified by:
      append in interface CharsetStringBuilder
      Parameters:
      chars - sequence of decoded characters
      offset - offset into the array
      length - the number of character to append from the sequence.
    • append

      public void append(byte[] b, int offset, int length)
      Specified by:
      append in interface CharsetStringBuilder
      Parameters:
      b - Array of encoded bytes
      offset - offset into the array
      length - the number of bytes to append from the array.
    • append

      public void append(ByteBuffer buf)
      Specified by:
      append in interface CharsetStringBuilder
      Parameters:
      buf - Buffer of encoded bytes to append. The bytes are consumed from the buffer.
    • build

      public String build() throws CharacterCodingException
      Description copied from interface: CharsetStringBuilder

      Build the completed string and reset the buffer.

      Specified by:
      build in interface CharsetStringBuilder
      Returns:
      The decoded built string which must be complete in regard to any multibyte sequences.
      Throws:
      CharacterCodingException - If the bytes cannot be correctly decoded or a multibyte sequence is incomplete.
    • length

      public int length()
      Specified by:
      length in interface CharsetStringBuilder
      Returns:
      the length in characters
    • reset

      public void reset()
      Description copied from interface: CharsetStringBuilder

      Resets this sequence to be empty.

      Specified by:
      reset in interface CharsetStringBuilder