Home / Function/ encodeByteBufAndTrailers() — netty Function Reference

encodeByteBufAndTrailers() — netty Function Reference

Architecture documentation for the encodeByteBufAndTrailers() function in HttpObjectEncoder.java from the netty codebase.

Function java ProtocolCodecs HTTP calls 1 called by 3

Entity Profile

Dependency Diagram

graph TD
  8e15dfab_2bf8_f636_56c6_05b88a79413b["encodeByteBufAndTrailers()"]
  14c61705_9541_276a_37fa_eaab6f15ec5a["HttpObjectEncoder"]
  8e15dfab_2bf8_f636_56c6_05b88a79413b -->|defined in| 14c61705_9541_276a_37fa_eaab6f15ec5a
  a790359d_1fc9_3acc_3deb_43ba277c843a["encodeByteBufContent()"]
  a790359d_1fc9_3acc_3deb_43ba277c843a -->|calls| 8e15dfab_2bf8_f636_56c6_05b88a79413b
  ff751625_d4a6_e38b_7393_ce3baf266fde["encodeLastHttpContent()"]
  ff751625_d4a6_e38b_7393_ce3baf266fde -->|calls| 8e15dfab_2bf8_f636_56c6_05b88a79413b
  73dee77d_2481_a5f6_e124_a913ffc8b63b["encodeHttpContent()"]
  73dee77d_2481_a5f6_e124_a913ffc8b63b -->|calls| 8e15dfab_2bf8_f636_56c6_05b88a79413b
  5a1c3f74_95b1_8e88_f9a6_79d4afc3659b["encodeChunkedHttpContent()"]
  8e15dfab_2bf8_f636_56c6_05b88a79413b -->|calls| 5a1c3f74_95b1_8e88_f9a6_79d4afc3659b
  style 8e15dfab_2bf8_f636_56c6_05b88a79413b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectEncoder.java lines 469–487

    private void encodeByteBufAndTrailers(int state, ChannelHandlerContext ctx, List<Object> out, ByteBuf content,
                                          HttpHeaders trailingHeaders) {
        switch (state) {
            case ST_CONTENT_NON_CHUNK:
                if (content.isReadable()) {
                    out.add(content.retain());
                    break;
                }
                // fall-through!
            case ST_CONTENT_ALWAYS_EMPTY:
                out.add(Unpooled.EMPTY_BUFFER);
                break;
            case ST_CONTENT_CHUNK:
                encodeChunkedHttpContent(ctx, content, trailingHeaders, out);
                break;
            default:
                throw new Error("Unexpected http object encoder state: " + state);
        }
    }

Subdomains

Frequently Asked Questions

What does encodeByteBufAndTrailers() do?
encodeByteBufAndTrailers() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectEncoder.java.
Where is encodeByteBufAndTrailers() defined?
encodeByteBufAndTrailers() is defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectEncoder.java at line 469.
What does encodeByteBufAndTrailers() call?
encodeByteBufAndTrailers() calls 1 function(s): encodeChunkedHttpContent.
What calls encodeByteBufAndTrailers()?
encodeByteBufAndTrailers() is called by 3 function(s): encodeByteBufContent, encodeHttpContent, encodeLastHttpContent.

Analyze Your Own Codebase

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

Try Supermodel Free