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
-
Nested Class Summary
Nested classes/interfaces inherited from interface CharsetStringBuilder
CharsetStringBuilder.DecoderStringBuilder, CharsetStringBuilder.Iso88591StringBuilder, CharsetStringBuilder.UsAsciiStringBuilder -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBufferprivate final CharsetDecoderprivate final StringBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(byte b) voidappend(byte[] b, int offset, int length) voidappend(char c) voidappend(CharSequence chars, int offset, int length) voidappend(ByteBuffer buf) build()Build the completed string and reset the buffer.private voidensureSpace(int needed) voidreset()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CharsetStringBuilder
append
-
Field Details
-
_decoder
-
_stringBuilder
-
_buffer
-
-
Constructor Details
-
DecoderStringBuilder
-
-
Method Details
-
ensureSpace
private void ensureSpace(int needed) -
append
public void append(byte b) - Specified by:
appendin interfaceCharsetStringBuilder- Parameters:
b- An encoded byte to append
-
append
public void append(char c) - Specified by:
appendin interfaceCharsetStringBuilder- Parameters:
c- A decoded character to append
-
append
- Specified by:
appendin interfaceCharsetStringBuilder- Parameters:
chars- sequence of decoded charactersoffset- offset into the arraylength- the number of character to append from the sequence.
-
append
public void append(byte[] b, int offset, int length) - Specified by:
appendin interfaceCharsetStringBuilder- Parameters:
b- Array of encoded bytesoffset- offset into the arraylength- the number of bytes to append from the array.
-
append
- Specified by:
appendin interfaceCharsetStringBuilder- Parameters:
buf- Buffer of encoded bytes to append. The bytes are consumed from the buffer.
-
build
Description copied from interface:CharsetStringBuilderBuild the completed string and reset the buffer.
- Specified by:
buildin interfaceCharsetStringBuilder- 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.
-
reset
public void reset()- Specified by:
resetin interfaceCharsetStringBuilder
-