Package org.bluezoo.gumdrop.http.hpack
Class Decoder
java.lang.Object
org.bluezoo.gumdrop.http.hpack.Decoder
HPACK header block decoder (RFC 7541).
Decodes a compressed field block into HTTP/2 header fields using:
- Indexed header field representation (RFC 7541 section 6.1)
- Literal header field with incremental indexing (section 6.2.1)
- Literal header field without indexing (section 6.2.2)
- Literal header field never indexed (section 6.2.3)
- Dynamic table size update (section 6.3)
- Integer representation (section 5.1)
- String literal / Huffman decoding (section 5.2)
- Author:
- Chris Burdess
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionRFC 7541 Appendix A: Static Table Definition.protected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(ByteBuffer buf, HeaderHandler handler) Decode an HPACK-encoded sequence of bytes aka header block.protected static intheaderSize(Header header) RFC 7541 section 4.1: the size of an entry is the sum of its name's length in octets, its value's length in octets, and 32.static voidvoidsetHeaderTableSize(int size) Set the value of the SETTINGS_HEADER_TABLE_SIZE setting.protected static intRFC 7541 section 4.1: the size of a dynamic table is the sum of the size of its entries.
-
Field Details
-
STATIC_TABLE
RFC 7541 Appendix A: Static Table Definition. 61 entries (indices 1-61); index 0 is null (unused). -
STATIC_TABLE_SIZE
protected static final int STATIC_TABLE_SIZE
-
-
Constructor Details
-
Decoder
public Decoder(int headerTableSize) Constructor.- Parameters:
headerTableSize- the negotiated maximum size in bytes that the dynamic table is allowed to reach
-
-
Method Details
-
setHeaderTableSize
public void setHeaderTableSize(int size) Set the value of the SETTINGS_HEADER_TABLE_SIZE setting. -
decode
Decode an HPACK-encoded sequence of bytes aka header block.- Parameters:
buf- the header block- Throws:
IOException
-
main
- Throws:
Exception
-
tableSize
RFC 7541 section 4.1: the size of a dynamic table is the sum of the size of its entries. -
headerSize
RFC 7541 section 4.1: the size of an entry is the sum of its name's length in octets, its value's length in octets, and 32. Calculated using uncompressed lengths (no Huffman encoding applied).
-