Package io.netty.handler.codec.http2
Class DefaultHttp2HeadersEncoder
java.lang.Object
io.netty.handler.codec.http2.DefaultHttp2HeadersEncoder
- All Implemented Interfaces:
Http2HeadersEncoder
,Http2HeadersEncoder.Configuration
,Closeable
,AutoCloseable
@UnstableApi
public class DefaultHttp2HeadersEncoder
extends Object
implements Http2HeadersEncoder, Http2HeadersEncoder.Configuration, Closeable
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.handler.codec.http2.Http2HeadersEncoder
Http2HeadersEncoder.Configuration, Http2HeadersEncoder.SensitivityDetector
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HpackEncoder
private final Http2HeadersEncoder.SensitivityDetector
private ByteBuf
Fields inherited from interface io.netty.handler.codec.http2.Http2HeadersEncoder
ALWAYS_SENSITIVE, NEVER_SENSITIVE
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttp2HeadersEncoder
(Http2HeadersEncoder.SensitivityDetector sensitivityDetector) DefaultHttp2HeadersEncoder
(Http2HeadersEncoder.SensitivityDetector sensitivityDetector, boolean ignoreMaxHeaderListSize) DefaultHttp2HeadersEncoder
(Http2HeadersEncoder.SensitivityDetector sensitivityDetector, boolean ignoreMaxHeaderListSize, int dynamicTableArraySizeHint) DefaultHttp2HeadersEncoder
(Http2HeadersEncoder.SensitivityDetector sensitivityDetector, boolean ignoreMaxHeaderListSize, int dynamicTableArraySizeHint, int huffCodeThreshold) DefaultHttp2HeadersEncoder
(Http2HeadersEncoder.SensitivityDetector sensitivityDetector, HpackEncoder hpackEncoder) Exposed Used for testing only! Default values used in the initial settings frame are overridden intentionally for testing but violate the RFC if used outside the scope of testing. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the encoder and release all its associated data.Get theHttp2HeadersEncoder.Configuration
for thisHttp2HeadersEncoder
void
encodeHeaders
(int streamId, Http2Headers headers, ByteBuf buffer) Encodes the given headers and writes the output headers block to the given output buffer.long
Represents the value for SETTINGS_MAX_HEADER_LIST_SIZE.void
maxHeaderListSize
(long max) Represents the value for SETTINGS_MAX_HEADER_LIST_SIZE.long
Represents the value for SETTINGS_HEADER_TABLE_SIZE.void
maxHeaderTableSize
(long max) Represents the value for SETTINGS_HEADER_TABLE_SIZE.
-
Field Details
-
hpackEncoder
-
sensitivityDetector
-
tableSizeChangeOutput
-
-
Constructor Details
-
DefaultHttp2HeadersEncoder
public DefaultHttp2HeadersEncoder() -
DefaultHttp2HeadersEncoder
-
DefaultHttp2HeadersEncoder
public DefaultHttp2HeadersEncoder(Http2HeadersEncoder.SensitivityDetector sensitivityDetector, boolean ignoreMaxHeaderListSize) -
DefaultHttp2HeadersEncoder
public DefaultHttp2HeadersEncoder(Http2HeadersEncoder.SensitivityDetector sensitivityDetector, boolean ignoreMaxHeaderListSize, int dynamicTableArraySizeHint) -
DefaultHttp2HeadersEncoder
public DefaultHttp2HeadersEncoder(Http2HeadersEncoder.SensitivityDetector sensitivityDetector, boolean ignoreMaxHeaderListSize, int dynamicTableArraySizeHint, int huffCodeThreshold) -
DefaultHttp2HeadersEncoder
DefaultHttp2HeadersEncoder(Http2HeadersEncoder.SensitivityDetector sensitivityDetector, HpackEncoder hpackEncoder) Exposed Used for testing only! Default values used in the initial settings frame are overridden intentionally for testing but violate the RFC if used outside the scope of testing.
-
-
Method Details
-
encodeHeaders
Description copied from interface:Http2HeadersEncoder
Encodes the given headers and writes the output headers block to the given output buffer.- Specified by:
encodeHeaders
in interfaceHttp2HeadersEncoder
- Parameters:
streamId
- the identifier of the stream for which the headers are encoded.headers
- the headers to be encoded.buffer
- the buffer to receive the encoded headers.- Throws:
Http2Exception
-
maxHeaderTableSize
Description copied from interface:Http2HeadersEncoder.Configuration
Represents the value for SETTINGS_HEADER_TABLE_SIZE. This method should only be called by Netty (not users) as a result of a receiving aSETTINGS
frame.- Specified by:
maxHeaderTableSize
in interfaceHttp2HeadersEncoder.Configuration
- Throws:
Http2Exception
-
maxHeaderTableSize
public long maxHeaderTableSize()Description copied from interface:Http2HeadersEncoder.Configuration
Represents the value for SETTINGS_HEADER_TABLE_SIZE. The initial value returned by this method must beHttp2CodecUtil.DEFAULT_HEADER_TABLE_SIZE
.- Specified by:
maxHeaderTableSize
in interfaceHttp2HeadersEncoder.Configuration
-
maxHeaderListSize
Description copied from interface:Http2HeadersEncoder.Configuration
Represents the value for SETTINGS_MAX_HEADER_LIST_SIZE. This method should only be called by Netty (not users) as a result of a receiving aSETTINGS
frame.- Specified by:
maxHeaderListSize
in interfaceHttp2HeadersEncoder.Configuration
- Throws:
Http2Exception
-
maxHeaderListSize
public long maxHeaderListSize()Description copied from interface:Http2HeadersEncoder.Configuration
Represents the value for SETTINGS_MAX_HEADER_LIST_SIZE.- Specified by:
maxHeaderListSize
in interfaceHttp2HeadersEncoder.Configuration
-
configuration
Description copied from interface:Http2HeadersEncoder
Get theHttp2HeadersEncoder.Configuration
for thisHttp2HeadersEncoder
- Specified by:
configuration
in interfaceHttp2HeadersEncoder
-
close
public void close()Close the encoder and release all its associated data.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-