Class HuffmanEncoder
java.lang.Object
org.eclipse.jetty.http.compression.HuffmanEncoder
Used to encode strings Huffman encoding.
Characters are encoded with ISO-8859-1, if any multi-byte characters or
control characters are present the encoder will throw EncodingException.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidencode(ByteBuffer buffer, String s) static voidencodeLowerCase(ByteBuffer buffer, String s) static intoctetsNeeded(byte[] b) static intstatic int
-
Method Details
-
octetsNeeded
- Parameters:
s- the string to encode.- Returns:
- the number of octets needed to encode the string, or -1 if it cannot be encoded.
-
octetsNeeded
public static int octetsNeeded(byte[] b) - Parameters:
b- the byte array to encode.- Returns:
- the number of octets needed to encode the bytes, or -1 if it cannot be encoded.
-
encode
- Parameters:
buffer- the buffer to encode into.s- the string to encode.
-
octetsNeededLowerCase
- Parameters:
s- the string to encode in lowercase.- Returns:
- the number of octets needed to encode the string, or -1 if it cannot be encoded.
-
encodeLowerCase
- Parameters:
buffer- the buffer to encode into in lowercase.s- the string to encode.
-