HttpDecoderConfig Class — netty Architecture
Architecture documentation for the HttpDecoderConfig class in HttpDecoderConfig.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 45baf646_b9f5_3769_48e7_9065fbb0d1db["HttpDecoderConfig"] 534a6a74_50b2_9ff9_7b70_cc6370837433["HttpDecoderConfig.java"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|defined in| 534a6a74_50b2_9ff9_7b70_cc6370837433 371fbd5f_834c_d57f_cce0_e099ba76f84b["getInitialBufferSize()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| 371fbd5f_834c_d57f_cce0_e099ba76f84b e2563906_8694_5f49_a6ec_f5ceaaf6ecd2["HttpDecoderConfig()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| e2563906_8694_5f49_a6ec_f5ceaaf6ecd2 43ccf31d_ba5c_0ca5_6577_496ec220549d["getMaxInitialLineLength()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| 43ccf31d_ba5c_0ca5_6577_496ec220549d 7f783b6b_7d35_7bac_e17c_38ede7adbede["getMaxHeaderSize()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| 7f783b6b_7d35_7bac_e17c_38ede7adbede 60871433_acbe_18b3_90e6_e335e21cd386["getMaxChunkSize()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| 60871433_acbe_18b3_90e6_e335e21cd386 5e7926c3_8ce6_cae5_5e1b_914c5882d6ff["isChunkedSupported()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| 5e7926c3_8ce6_cae5_5e1b_914c5882d6ff c913c6f1_f2df_2e03_7cae_f2b4a69a10ce["isAllowPartialChunks()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| c913c6f1_f2df_2e03_7cae_f2b4a69a10ce 4ee99a65_a177_9a4c_7941_cf4c21d61941["HttpHeadersFactory()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| 4ee99a65_a177_9a4c_7941_cf4c21d61941 1247fafe_338a_4181_0ac5_400b264afb46["isAllowDuplicateContentLengths()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| 1247fafe_338a_4181_0ac5_400b264afb46 31d21016_62fd_4a6a_d5bb_5ccd1cf8b8e7["isStrictLineParsing()"] 45baf646_b9f5_3769_48e7_9065fbb0d1db -->|method| 31d21016_62fd_4a6a_d5bb_5ccd1cf8b8e7
Relationship Graph
Source Code
codec-http/src/main/java/io/netty/handler/codec/http/HttpDecoderConfig.java lines 27–258
public final class HttpDecoderConfig implements Cloneable {
private int maxChunkSize = HttpObjectDecoder.DEFAULT_MAX_CHUNK_SIZE;
private boolean chunkedSupported = HttpObjectDecoder.DEFAULT_CHUNKED_SUPPORTED;
private boolean allowPartialChunks = HttpObjectDecoder.DEFAULT_ALLOW_PARTIAL_CHUNKS;
private HttpHeadersFactory headersFactory = DefaultHttpHeadersFactory.headersFactory();
private HttpHeadersFactory trailersFactory = DefaultHttpHeadersFactory.trailersFactory();
private boolean allowDuplicateContentLengths = HttpObjectDecoder.DEFAULT_ALLOW_DUPLICATE_CONTENT_LENGTHS;
private int maxInitialLineLength = HttpObjectDecoder.DEFAULT_MAX_INITIAL_LINE_LENGTH;
private int maxHeaderSize = HttpObjectDecoder.DEFAULT_MAX_HEADER_SIZE;
private int initialBufferSize = HttpObjectDecoder.DEFAULT_INITIAL_BUFFER_SIZE;
private boolean strictLineParsing = HttpObjectDecoder.DEFAULT_STRICT_LINE_PARSING;
public int getInitialBufferSize() {
return initialBufferSize;
}
/**
* Set the initial size of the temporary buffer used when parsing the lines of the HTTP headers.
*
* @param initialBufferSize The buffer size in bytes.
* @return This decoder config.
*/
public HttpDecoderConfig setInitialBufferSize(int initialBufferSize) {
checkPositive(initialBufferSize, "initialBufferSize");
this.initialBufferSize = initialBufferSize;
return this;
}
public int getMaxInitialLineLength() {
return maxInitialLineLength;
}
/**
* Set the maximum length of the first line of the HTTP header.
* This limits how much memory Netty will use when parsed the initial HTTP header line.
* You would typically set this to the same value as {@link #setMaxHeaderSize(int)}.
*
* @param maxInitialLineLength The maximum length, in bytes.
* @return This decoder config.
*/
public HttpDecoderConfig setMaxInitialLineLength(int maxInitialLineLength) {
checkPositive(maxInitialLineLength, "maxInitialLineLength");
this.maxInitialLineLength = maxInitialLineLength;
return this;
}
public int getMaxHeaderSize() {
return maxHeaderSize;
}
/**
* Set the maximum line length of header lines.
* This limits how much memory Netty will use when parsing HTTP header key-value pairs.
* The limit applies to the sum of all the headers, so it applies equally to many short header-lines,
* or fewer but longer header lines.
* <p>
* You would typically set this to the same value as {@link #setMaxInitialLineLength(int)}.
*
* @param maxHeaderSize The maximum length, in bytes.
* @return This decoder config.
*/
public HttpDecoderConfig setMaxHeaderSize(int maxHeaderSize) {
checkPositive(maxHeaderSize, "maxHeaderSize");
this.maxHeaderSize = maxHeaderSize;
return this;
}
public int getMaxChunkSize() {
return maxChunkSize;
}
/**
* Set the maximum chunk size.
* HTTP requests and responses can be quite large, in which case it's better to process the data as a stream of
* chunks.
* This sets the limit, in bytes, at which Netty will send a chunk down the pipeline.
*
* @param maxChunkSize The maximum chunk size, in bytes.
* @return This decoder config.
*/
public HttpDecoderConfig setMaxChunkSize(int maxChunkSize) {
Source
Frequently Asked Questions
What is the HttpDecoderConfig class?
HttpDecoderConfig is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpDecoderConfig.java.
Where is HttpDecoderConfig defined?
HttpDecoderConfig is defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpDecoderConfig.java at line 27.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free