Package io.netty.handler.codec.http2
Class HpackHuffmanDecoder
- java.lang.Object
-
- io.netty.handler.codec.http2.HpackHuffmanDecoder
-
- All Implemented Interfaces:
ByteProcessor
final class HpackHuffmanDecoder extends java.lang.Object implements ByteProcessor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.util.ByteProcessor
ByteProcessor.IndexNotOfProcessor, ByteProcessor.IndexOfProcessor
-
-
Field Summary
Fields Modifier and Type Field Description private static Http2Exception
BAD_ENCODING
private byte[]
dest
private static byte
HUFFMAN_COMPLETE
private static int
HUFFMAN_COMPLETE_SHIFT
private static byte
HUFFMAN_EMIT_SYMBOL
private static int
HUFFMAN_EMIT_SYMBOL_SHIFT
private static byte
HUFFMAN_FAIL
private static int
HUFFMAN_FAIL_SHIFT
private static int[]
HUFFS
A table of byte tuples (state, flags, output).private int
k
private int
state
-
Fields inherited from interface io.netty.util.ByteProcessor
FIND_ASCII_SPACE, FIND_COMMA, FIND_CR, FIND_CRLF, FIND_LF, FIND_LINEAR_WHITESPACE, FIND_NON_CR, FIND_NON_CRLF, FIND_NON_LF, FIND_NON_LINEAR_WHITESPACE, FIND_NON_NUL, FIND_NUL, FIND_SEMI_COLON
-
-
Constructor Summary
Constructors Constructor Description HpackHuffmanDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsciiString
decode(ByteBuf buf, int length)
Decompresses the given Huffman coded string literal.boolean
process(byte input)
This should never be called from anything but this class itself!private boolean
processNibble(int input)
-
-
-
Field Detail
-
HUFFMAN_COMPLETE
private static final byte HUFFMAN_COMPLETE
- See Also:
- Constant Field Values
-
HUFFMAN_EMIT_SYMBOL
private static final byte HUFFMAN_EMIT_SYMBOL
- See Also:
- Constant Field Values
-
HUFFMAN_FAIL
private static final byte HUFFMAN_FAIL
- See Also:
- Constant Field Values
-
HUFFMAN_COMPLETE_SHIFT
private static final int HUFFMAN_COMPLETE_SHIFT
- See Also:
- Constant Field Values
-
HUFFMAN_EMIT_SYMBOL_SHIFT
private static final int HUFFMAN_EMIT_SYMBOL_SHIFT
- See Also:
- Constant Field Values
-
HUFFMAN_FAIL_SHIFT
private static final int HUFFMAN_FAIL_SHIFT
- See Also:
- Constant Field Values
-
HUFFS
private static final int[] HUFFS
A table of byte tuples (state, flags, output). They are packed together as: state<<16 + flags<<8 + output
-
BAD_ENCODING
private static final Http2Exception BAD_ENCODING
-
dest
private byte[] dest
-
k
private int k
-
state
private int state
-
-
Method Detail
-
decode
public AsciiString decode(ByteBuf buf, int length) throws Http2Exception
Decompresses the given Huffman coded string literal.- Parameters:
buf
- the string literal to be decoded- Returns:
- the output stream for the compressed data
- Throws:
Http2Exception
- EOS Decoded
-
process
public boolean process(byte input)
This should never be called from anything but this class itself!- Specified by:
process
in interfaceByteProcessor
- Returns:
true
if the processor wants to continue the loop and handle the next byte in the buffer.false
if the processor wants to stop handling bytes and abort the loop.
-
processNibble
private boolean processNibble(int input)
-
-