Home / Class/ HttpRequestDecoder Class — netty Architecture

HttpRequestDecoder Class — netty Architecture

Architecture documentation for the HttpRequestDecoder class in HttpRequestDecoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4589186b_4bcc_122c_2013_a0e40fd58a92["HttpRequestDecoder"]
  e5734ca9_2609_da38_e728_e8002703b1d0["HttpRequestDecoder.java"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|defined in| e5734ca9_2609_da38_e728_e8002703b1d0
  642f0e9f_ed91_febc_b5d8_7cbc7b9d8908["HttpRequestDecoder()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| 642f0e9f_ed91_febc_b5d8_7cbc7b9d8908
  b2e3cd21_42a3_45b7_ef44_ba537f791ecc["HttpMessage()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| b2e3cd21_42a3_45b7_ef44_ba537f791ecc
  74fbc3b2_d53f_c201_3682_db8c061ddf60["AsciiString()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| 74fbc3b2_d53f_c201_3682_db8c061ddf60
  c0227fa4_3347_d5da_3b8e_3b6f565e6c93["isAccept()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| c0227fa4_3347_d5da_3b8e_3b6f565e6c93
  d9eb0b50_a2c4_bd1e_41bd_38ce052f94cf["isHost()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| d9eb0b50_a2c4_bd1e_41bd_38ce052f94cf
  b04e5ca6_683b_83c8_73b0_7e040dc6f8fd["isConnection()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| b04e5ca6_683b_83c8_73b0_7e040dc6f8fd
  15b652eb_f455_865c_0121_3466d53c60bb["isContentType()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| 15b652eb_f455_865c_0121_3466d53c60bb
  ee084111_b33d_781d_f618_45168de21b0a["isContentLength()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| ee084111_b33d_781d_f618_45168de21b0a
  ee5451d9_a2c1_18a0_8bb5_b609b1d08233["isGetMethod()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| ee5451d9_a2c1_18a0_8bb5_b609b1d08233
  a4458893_fb79_577f_3220_7de94967614c["isPostMethod()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| a4458893_fb79_577f_3220_7de94967614c
  09566f6c_f33d_6ed1_3bc1_ea2e2fc4de1b["String()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| 09566f6c_f33d_6ed1_3bc1_ea2e2fc4de1b
  c4de439e_6d6b_9b88_51f7_4389607cff2e["isDecodingRequest()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| c4de439e_6d6b_9b88_51f7_4389607cff2e
  1870b6f4_f8d6_9ea4_aceb_aa272abf5316["isContentAlwaysEmpty()"]
  4589186b_4bcc_122c_2013_a0e40fd58a92 -->|method| 1870b6f4_f8d6_9ea4_aceb_aa272abf5316

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/HttpRequestDecoder.java lines 91–398

public class HttpRequestDecoder extends HttpObjectDecoder {

    private static final AsciiString Accept = AsciiString.cached("Accept");
    private static final AsciiString Host = AsciiString.cached("Host");
    private static final AsciiString Connection = AsciiString.cached("Connection");
    private static final AsciiString ContentType = AsciiString.cached("Content-Type");
    private static final AsciiString ContentLength = AsciiString.cached("Content-Length");

    private static final int GET_AS_INT = 'G' | 'E' << 8 | 'T' << 16;
    private static final int POST_AS_INT = 'P' | 'O' << 8 | 'S' << 16 | 'T' << 24;
    private static final long HTTP_1_1_AS_LONG = 'H' | 'T' << 8 | 'T' << 16 | 'P' << 24 | (long) '/' << 32 |
            (long) '1' << 40 | (long) '.' << 48 | (long) '1' << 56;

    private static final long HTTP_1_0_AS_LONG = 'H' | 'T' << 8 | 'T' << 16 | 'P' << 24 | (long) '/' << 32 |
            (long) '1' << 40 | (long) '.' << 48 | (long) '0' << 56;

    private static final int HOST_AS_INT = 'H' | 'o' << 8 | 's' << 16 | 't' << 24;

    private static final long CONNECTION_AS_LONG_0 = 'C' | 'o' << 8 | 'n' << 16 | 'n' << 24 |
            (long) 'e' << 32 | (long) 'c' << 40 | (long) 't' << 48 | (long) 'i' << 56;

    private static final short CONNECTION_AS_SHORT_1 = 'o' | 'n' << 8;

    private static final long CONTENT_AS_LONG = 'C' | 'o' << 8 | 'n' << 16 | 't' << 24 |
            (long) 'e' << 32 | (long) 'n' << 40 | (long) 't' << 48 | (long) '-' << 56;

    private static final int TYPE_AS_INT = 'T' | 'y' << 8 | 'p' << 16 | 'e' << 24;

    private static final long LENGTH_AS_LONG = 'L' | 'e' << 8 | 'n' << 16 | 'g' << 24 |
            (long) 't' << 32 | (long) 'h' << 40;

    private static final long ACCEPT_AS_LONG = 'A' | 'c' << 8 | 'c' << 16 | 'e' << 24 |
            (long) 'p' << 32 | (long) 't' << 40;

    /**
     * Creates a new instance with the default
     * {@code maxInitialLineLength (4096)}, {@code maxHeaderSize (8192)}, and
     * {@code maxChunkSize (8192)}.
     * @see HttpDecoderConfig HttpDecoderConfig API documentation for detailed descriptions of
     * the configuration parameters.
     */
    public HttpRequestDecoder() {
    }

    /**
     * Creates a new instance with the specified parameters.
     *
     * @param maxInitialLineLength the initial size of the temporary buffer used when parsing the lines of the
     * HTTP headers.
     * @param maxHeaderSize the maximum permitted combined size of all headers in any one request.
     * @param maxChunkSize The maximum amount of data that the decoder will buffer
     * before sending chunks down the pipeline.
     * @see HttpDecoderConfig HttpDecoderConfig API documentation for detailed descriptions of
     * the configuration parameters.
     */
    public HttpRequestDecoder(
            int maxInitialLineLength, int maxHeaderSize, int maxChunkSize) {
        this(new HttpDecoderConfig()
                .setMaxInitialLineLength(maxInitialLineLength)
                .setMaxHeaderSize(maxHeaderSize)
                .setMaxChunkSize(maxChunkSize));
    }

    /**
     * @deprecated Prefer the {@link #HttpRequestDecoder(HttpDecoderConfig)} constructor,
     * to always have header validation enabled.
     * @see HttpDecoderConfig HttpDecoderConfig API documentation for detailed descriptions of
     * the configuration parameters.
     */
    @Deprecated
    public HttpRequestDecoder(
            int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders) {
        super(maxInitialLineLength, maxHeaderSize, maxChunkSize, DEFAULT_CHUNKED_SUPPORTED, validateHeaders);
    }

    /**
     * @deprecated Prefer the {@link #HttpRequestDecoder(HttpDecoderConfig)} constructor,
     * to always have header validation enabled.
     * @see HttpDecoderConfig HttpDecoderConfig API documentation for detailed descriptions of
     * the configuration parameters.
     */

Frequently Asked Questions

What is the HttpRequestDecoder class?
HttpRequestDecoder is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpRequestDecoder.java.
Where is HttpRequestDecoder defined?
HttpRequestDecoder is defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpRequestDecoder.java at line 91.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free