Package io.undertow.protocols.http2
Class HPackHuffman
java.lang.Object
io.undertow.protocols.http2.HPackHuffman
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
decode
(ByteBuffer data, int length, StringBuilder target) Decodes a huffman encoded string into the target StringBuilder.static boolean
encode
(ByteBuffer buffer, String toEncode, boolean forceLowercase) Encodes the given string into the buffer.
-
Constructor Details
-
HPackHuffman
public HPackHuffman()
-
-
Method Details
-
decode
Decodes a huffman encoded string into the target StringBuilder. There must be enough space left in the buffer for this method to succeed.- Parameters:
data
- The byte bufferlength
- The data lengthtarget
- The target for the decompressed data- Throws:
HpackException
-
encode
Encodes the given string into the buffer. If there is not enough space in the buffer, or the encoded version is bigger than the original it will return false and not modify the buffers position- Parameters:
buffer
- The buffer to encode intotoEncode
- The string to encodeforceLowercase
- If the string should be encoded in lower case- Returns:
- true if encoding succeeded
-