Home / Function/ encodeFileRegionContent() — netty Function Reference

encodeFileRegionContent() — netty Function Reference

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

Function java ProtocolCodecs HTTP calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  4d5953cb_854c_5e28_6a1b_484139dd485f["encodeFileRegionContent()"]
  14c61705_9541_276a_37fa_eaab6f15ec5a["HttpObjectEncoder"]
  4d5953cb_854c_5e28_6a1b_484139dd485f -->|defined in| 14c61705_9541_276a_37fa_eaab6f15ec5a
  9ac1b386_8738_51d3_522c_d4e7b37c3049["encodeNotHttpMessageContentTypes()"]
  9ac1b386_8738_51d3_522c_d4e7b37c3049 -->|calls| 4d5953cb_854c_5e28_6a1b_484139dd485f
  18cc7b78_3c6e_f726_9bf6_777174f30988["encode()"]
  4d5953cb_854c_5e28_6a1b_484139dd485f -->|calls| 18cc7b78_3c6e_f726_9bf6_777174f30988
  c76774a6_9669_6152_6709_d25975383f27["encodedChunkedFileRegionContent()"]
  4d5953cb_854c_5e28_6a1b_484139dd485f -->|calls| c76774a6_9669_6152_6709_d25975383f27
  style 4d5953cb_854c_5e28_6a1b_484139dd485f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectEncoder.java lines 373–403

    private void encodeFileRegionContent(ChannelHandlerContext ctx, FileRegion msg, List<Object> out) {
        try {
            assert state != ST_INIT;
            switch (state) {
                case ST_CONTENT_NON_CHUNK:
                    if (msg.count() > 0) {
                        out.add(msg.retain());
                        break;
                    }

                    // fall-through!
                case ST_CONTENT_ALWAYS_EMPTY:
                    // Need to produce some output otherwise an
                    // IllegalStateException will be thrown as we did not write anything
                    // Its ok to just write an EMPTY_BUFFER as if there are reference count issues these will be
                    // propagated as the caller of the encode(...) method will release the original
                    // buffer.
                    // Writing an empty buffer will not actually write anything on the wire, so if there is a user
                    // error with msg it will not be visible externally
                    out.add(Unpooled.EMPTY_BUFFER);
                    break;
                case ST_CONTENT_CHUNK:
                    encodedChunkedFileRegionContent(ctx, msg, out);
                    break;
                default:
                    throw new Error("Unexpected http object encoder state: " + state);
            }
        } finally {
            msg.release();
        }
    }

Subdomains

Frequently Asked Questions

What does encodeFileRegionContent() do?
encodeFileRegionContent() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectEncoder.java.
Where is encodeFileRegionContent() defined?
encodeFileRegionContent() is defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectEncoder.java at line 373.
What does encodeFileRegionContent() call?
encodeFileRegionContent() calls 2 function(s): encode, encodedChunkedFileRegionContent.
What calls encodeFileRegionContent()?
encodeFileRegionContent() is called by 1 function(s): encodeNotHttpMessageContentTypes.

Analyze Your Own Codebase

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

Try Supermodel Free