Used to decode string literals as described in RFC7541.
The string literal representation consists of a single bit to indicate whether huffman encoding is used, followed by the string byte length encoded with the n-bit integer representation also from RFC7541, and the bytes of the string are directly after this.
Characters which are illegal field-vchar values are replaced with either ' ' or '?' as described in RFC9110
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final CharsetStringBuilder. | |
| private int | |
| private boolean | |
| private final HuffmanDecoder | |
| private final NBitIntegerDecoder | |
| private int | |
| private int | |
| private NBitStringDecoder. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the decoded string or null to indicate that more data is needed.the buffer containing the encoded string. buffer)Decode a string from the buffer. |
| public void | |
| public void | setPrefix(int
the number of bits in the string prefix. prefix)Set the prefix length in of the string representation in bits. |
| private String |
| _builder | back to summary |
|---|---|
| private final CharsetStringBuilder. | |
| _count | back to summary |
|---|---|
| private int _count | |
| _huffman | back to summary |
|---|---|
| private boolean _huffman | |
| _huffmanBuilder | back to summary |
|---|---|
| private final HuffmanDecoder _huffmanBuilder | |
| _integerDecoder | back to summary |
|---|---|
| private final NBitIntegerDecoder _integerDecoder | |
| _length | back to summary |
|---|---|
| private int _length | |
| _prefix | back to summary |
|---|---|
| private int _prefix | |
| _state | back to summary |
|---|---|
| private NBitStringDecoder. | |
| NBitStringDecoder | back to summary |
|---|---|
| public NBitStringDecoder() | |
| decode | back to summary |
|---|---|
| public String decode(ByteBuffer buffer) throws EncodingException Decode a string from the buffer. If the buffer does not contain the complete string representation
then a value of null is returned to indicate that more data is needed to complete parsing.
This should be only after the prefix has been set with
| |
| reset | back to summary |
|---|---|
| public void reset() | |
| setPrefix | back to summary |
|---|---|
| public void setPrefix(int prefix) Set the prefix length in of the string representation in bits. A prefix of 6 means the string representation starts after the first 2 bits.
| |
| stringDecode | back to summary |
|---|---|
| private String stringDecode(ByteBuffer buffer) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final NBitStringDecoder. | |
| public static final NBitStringDecoder. | |
| public static final NBitStringDecoder. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static NBitStringDecoder. | |
| public static NBitStringDecoder. |
| LENGTH | back to summary |
|---|---|
| public static final NBitStringDecoder. | |
| PARSING | back to summary |
|---|---|
| public static final NBitStringDecoder. | |
| VALUE | back to summary |
|---|---|
| public static final NBitStringDecoder. | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static NBitStringDecoder. | |
| values | back to summary |
|---|---|
| public static NBitStringDecoder. | |