Package org.apache.hc.core5.http2.hpack
Class HPackDecoder
- java.lang.Object
-
- org.apache.hc.core5.http2.hpack.HPackDecoder
-
@Internal public final class HPackDecoder extends java.lang.Object
HPACK decoder.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.charset.CharsetDecoder
charsetDecoder
private ByteArrayBuffer
contentBuf
private InboundDynamicTable
dynamicTable
private static java.lang.String
MAX_LIMIT_EXCEEDED
private int
maxListSize
private int
maxTableSize
private java.nio.CharBuffer
tmpBuf
private static java.lang.String
UNEXPECTED_EOS
-
Constructor Summary
Constructors Constructor Description HPackDecoder(java.nio.charset.Charset charset)
HPackDecoder(java.nio.charset.CharsetDecoder charsetDecoder)
HPackDecoder(InboundDynamicTable dynamicTable, java.nio.charset.Charset charset)
HPackDecoder(InboundDynamicTable dynamicTable, java.nio.charset.CharsetDecoder charsetDecoder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
clearState()
Header
decodeHeader(java.nio.ByteBuffer src)
java.util.List<Header>
decodeHeaders(java.nio.ByteBuffer src)
(package private) HPackHeader
decodeHPackHeader(java.nio.ByteBuffer src)
(package private) static void
decodeHuffman(ByteArrayBuffer buffer, java.nio.ByteBuffer src)
(package private) HPackHeader
decodeIndexedHeader(java.nio.ByteBuffer src)
(package private) static int
decodeInt(java.nio.ByteBuffer src, int n)
(package private) HPackHeader
decodeLiteralHeader(java.nio.ByteBuffer src, HPackRepresentation representation)
(package private) static void
decodePlainString(ByteArrayBuffer buffer, java.nio.ByteBuffer src)
(package private) int
decodeString(java.nio.ByteBuffer src, java.lang.StringBuilder buf)
(package private) void
decodeString(ByteArrayBuffer buffer, java.nio.ByteBuffer src)
private void
ensureCapacity(int extra)
private void
expandCapacity(int capacity)
int
getMaxListSize()
int
getMaxTableSize()
(package private) static int
peekByte(java.nio.ByteBuffer src)
(package private) static int
readByte(java.nio.ByteBuffer src)
void
setMaxListSize(int maxListSize)
void
setMaxTableSize(int maxTableSize)
-
-
-
Field Detail
-
UNEXPECTED_EOS
private static final java.lang.String UNEXPECTED_EOS
- See Also:
- Constant Field Values
-
MAX_LIMIT_EXCEEDED
private static final java.lang.String MAX_LIMIT_EXCEEDED
- See Also:
- Constant Field Values
-
dynamicTable
private final InboundDynamicTable dynamicTable
-
contentBuf
private final ByteArrayBuffer contentBuf
-
charsetDecoder
private final java.nio.charset.CharsetDecoder charsetDecoder
-
tmpBuf
private java.nio.CharBuffer tmpBuf
-
maxTableSize
private int maxTableSize
-
maxListSize
private int maxListSize
-
-
Constructor Detail
-
HPackDecoder
HPackDecoder(InboundDynamicTable dynamicTable, java.nio.charset.CharsetDecoder charsetDecoder)
-
HPackDecoder
HPackDecoder(InboundDynamicTable dynamicTable, java.nio.charset.Charset charset)
-
HPackDecoder
public HPackDecoder(java.nio.charset.Charset charset)
-
HPackDecoder
public HPackDecoder(java.nio.charset.CharsetDecoder charsetDecoder)
-
-
Method Detail
-
readByte
static int readByte(java.nio.ByteBuffer src) throws HPackException
- Throws:
HPackException
-
peekByte
static int peekByte(java.nio.ByteBuffer src) throws HPackException
- Throws:
HPackException
-
decodeInt
static int decodeInt(java.nio.ByteBuffer src, int n) throws HPackException
- Throws:
HPackException
-
decodePlainString
static void decodePlainString(ByteArrayBuffer buffer, java.nio.ByteBuffer src) throws HPackException
- Throws:
HPackException
-
decodeHuffman
static void decodeHuffman(ByteArrayBuffer buffer, java.nio.ByteBuffer src) throws HPackException
- Throws:
HPackException
-
decodeString
void decodeString(ByteArrayBuffer buffer, java.nio.ByteBuffer src) throws HPackException
- Throws:
HPackException
-
clearState
private void clearState()
-
expandCapacity
private void expandCapacity(int capacity)
-
ensureCapacity
private void ensureCapacity(int extra)
-
decodeString
int decodeString(java.nio.ByteBuffer src, java.lang.StringBuilder buf) throws HPackException, java.nio.charset.CharacterCodingException
- Throws:
HPackException
java.nio.charset.CharacterCodingException
-
decodeLiteralHeader
HPackHeader decodeLiteralHeader(java.nio.ByteBuffer src, HPackRepresentation representation) throws HPackException, java.nio.charset.CharacterCodingException
- Throws:
HPackException
java.nio.charset.CharacterCodingException
-
decodeIndexedHeader
HPackHeader decodeIndexedHeader(java.nio.ByteBuffer src) throws HPackException
- Throws:
HPackException
-
decodeHeader
public Header decodeHeader(java.nio.ByteBuffer src) throws HPackException
- Throws:
HPackException
-
decodeHPackHeader
HPackHeader decodeHPackHeader(java.nio.ByteBuffer src) throws HPackException
- Throws:
HPackException
-
decodeHeaders
public java.util.List<Header> decodeHeaders(java.nio.ByteBuffer src) throws HPackException
- Throws:
HPackException
-
getMaxTableSize
public int getMaxTableSize()
-
setMaxTableSize
public void setMaxTableSize(int maxTableSize)
-
getMaxListSize
public int getMaxListSize()
-
setMaxListSize
public void setMaxListSize(int maxListSize)
-
-