Top Inners Fields Constructors Methods
io.netty.handler.codec.http2

pack-priv final Class HpackHuffmanEncoder

extends Object
Class Inheritance
Imports
io.netty.buffer.ByteBuf, io.netty.util.AsciiString, .ByteProcessor, io.netty.util.internal.ObjectUtil, .PlatformDependent

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private final int[]
private final HpackHuffmanEncoder.EncodedLengthProcessor
private final HpackHuffmanEncoder.EncodeProcessor
private final byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
private
HpackHuffmanEncoder(int[]
the Huffman codes indexed by symbol
codes
,
byte[]
the length of each Huffman code
lengths
)

Creates a new Huffman encoder with the specified Huffman coding.

Method Summary

Modifier and TypeMethod and Description
public void
encode(ByteBuf
the output stream for the compressed data
out
,
CharSequence
the string literal to be Huffman encoded
data
)

Compresses the input string literal using the Huffman coding.

private void
pack-priv int

Returns:

the number of bytes required to Huffman encode data
getEncodedLength
(CharSequence
the string literal to be Huffman encoded
data
)

Returns the number of bytes required to Huffman encode the input string literal.

private int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

codesback to summary
private final int[] codes
encodedLengthProcessorback to summary
private final HpackHuffmanEncoder.EncodedLengthProcessor encodedLengthProcessor
encodeProcessorback to summary
private final HpackHuffmanEncoder.EncodeProcessor encodeProcessor
lengthsback to summary
private final byte[] lengths

Constructor Detail

HpackHuffmanEncoderback to summary
pack-priv HpackHuffmanEncoder()
HpackHuffmanEncoderback to summary
private HpackHuffmanEncoder(int[] codes, byte[] lengths)

Creates a new Huffman encoder with the specified Huffman coding.

Parameters
codes:int[]

the Huffman codes indexed by symbol

lengths:byte[]

the length of each Huffman code

Method Detail

encodeback to summary
public void encode(ByteBuf out, CharSequence data)

Compresses the input string literal using the Huffman coding.

Parameters
out:ByteBuf

the output stream for the compressed data

data:CharSequence

the string literal to be Huffman encoded

encodeSlowPathback to summary
private void encodeSlowPath(ByteBuf out, CharSequence data)
getEncodedLengthback to summary
pack-priv int getEncodedLength(CharSequence data)

Returns the number of bytes required to Huffman encode the input string literal.

Parameters
data:CharSequence

the string literal to be Huffman encoded

Returns:int

the number of bytes required to Huffman encode data

getEncodedLengthSlowPathback to summary
private int getEncodedLengthSlowPath(CharSequence data)
io.netty.handler.codec.http2 back to summary

private final Class HpackHuffmanEncoder.EncodedLengthProcessor

extends Object
implements ByteProcessor
Class Inheritance
  • java.lang.Object
  • io.netty.handler.codec.http2.HpackHuffmanEncoder.EncodedLengthProcessor
All Implemented Interfaces
io.netty.util.ByteProcessor

Field Summary

Modifier and TypeField and Description
private long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv int
public boolean
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lenback to summary
private long len

Constructor Detail

EncodedLengthProcessorback to summary
private EncodedLengthProcessor()

Method Detail

lengthback to summary
pack-priv int length()
processback to summary
public boolean process(byte value)

Implements io.netty.util.ByteProcessor.process.

Returns:boolean

Doc from io.netty.util.ByteProcessor.process.

true if the processor wants to continue the loop and handle the next byte in the buffer. false if the processor wants to stop handling bytes and abort the loop.

Annotations
@Override
resetback to summary
pack-priv void reset()
io.netty.handler.codec.http2 back to summary

private final Class HpackHuffmanEncoder.EncodeProcessor

extends Object
implements ByteProcessor
Class Inheritance
  • java.lang.Object
  • io.netty.handler.codec.http2.HpackHuffmanEncoder.EncodeProcessor
All Implemented Interfaces
io.netty.util.ByteProcessor

Field Summary

Modifier and TypeField and Description
private long
private int
n

pack-priv ByteBuf

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv void
end()

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentback to summary
private long current
nback to summary
private int n
outback to summary
pack-priv ByteBuf out

Constructor Detail

EncodeProcessorback to summary
private EncodeProcessor()

Method Detail

endback to summary
pack-priv void end()
processback to summary
public boolean process(byte value)

Implements io.netty.util.ByteProcessor.process.

Returns:boolean

Doc from io.netty.util.ByteProcessor.process.

true if the processor wants to continue the loop and handle the next byte in the buffer. false if the processor wants to stop handling bytes and abort the loop.

Annotations
@Override