Package org.apache.coyote.http2
Class HPackHuffman
- java.lang.Object
- 
- org.apache.coyote.http2.HPackHuffman
 
- 
 public class HPackHuffman extends java.lang.Object
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classHPackHuffman.HuffmanCode
 - 
Field SummaryFields Modifier and Type Field Description protected static StringManagersm
 - 
Constructor SummaryConstructors Constructor Description HPackHuffman()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddecode(java.nio.ByteBuffer data, int length, java.lang.StringBuilder target)Decodes a huffman encoded string into the target StringBuilder.static booleanencode(java.nio.ByteBuffer buffer, java.lang.String toEncode, boolean forceLowercase)Encodes the given string into the buffer.
 
- 
- 
- 
Field Detail- 
smprotected static final StringManager sm 
 
- 
 - 
Method Detail- 
decodepublic static void decode(java.nio.ByteBuffer data, int length, java.lang.StringBuilder target) throws org.apache.coyote.http2.HpackExceptionDecodes 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 buffer
- length- The length of data from the buffer to decode
- target- The target for the decompressed data
- Throws:
- org.apache.coyote.http2.HpackException- If the Huffman encoded value in HPACK headers did not end with EOS padding
 
 - 
encodepublic static boolean encode(java.nio.ByteBuffer buffer, java.lang.String toEncode, boolean forceLowercase)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 into
- toEncode- The string to encode
- forceLowercase- If the string should be encoded in lower case
- Returns:
- true if encoding succeeded
 
 
- 
 
-