Home / Function/ readContent() — netty Function Reference

readContent() — netty Function Reference

Architecture documentation for the readContent() function in HttpContentDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9551636f_107c_5525_c2ac_6930ab7aab64["readContent()"]
  ea4ec426_b689_ab52_a554_7959aed6c709["HttpContentDecoderTest"]
  9551636f_107c_5525_c2ac_6930ab7aab64 -->|defined in| ea4ec426_b689_ab52_a554_7959aed6c709
  e0f9ca74_1f15_9dd0_32d3_4493874f9cdd["testFullHttpRequest()"]
  e0f9ca74_1f15_9dd0_32d3_4493874f9cdd -->|calls| 9551636f_107c_5525_c2ac_6930ab7aab64
  f74ab4f7_ab14_7d61_3fc4_3ae023957285["testFullHttpResponse()"]
  f74ab4f7_ab14_7d61_3fc4_3ae023957285 -->|calls| 9551636f_107c_5525_c2ac_6930ab7aab64
  48bb0a82_bab0_ddd2_1e20_706f61bda764["testFullHttpResponseEOF()"]
  48bb0a82_bab0_ddd2_1e20_706f61bda764 -->|calls| 9551636f_107c_5525_c2ac_6930ab7aab64
  style 9551636f_107c_5525_c2ac_6930ab7aab64 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java lines 850–866

    private static byte[] readContent(Queue<Object> req, int contentLength, boolean hasTransferEncoding) {
        byte[] receivedContent = new byte[contentLength];
        int readCount = 0;
        for (Object o : req) {
            if (o instanceof HttpContent) {
                ByteBuf b = ((HttpContent) o).content();
                int readableBytes = b.readableBytes();
                b.readBytes(receivedContent, readCount, readableBytes);
                readCount += readableBytes;
            }
            if (o instanceof HttpMessage) {
                assertEquals(hasTransferEncoding,
                        ((HttpMessage) o).headers().contains(HttpHeaderNames.TRANSFER_ENCODING));
            }
        }
        return receivedContent;
    }

Domain

Subdomains

Frequently Asked Questions

What does readContent() do?
readContent() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java.
Where is readContent() defined?
readContent() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java at line 850.
What calls readContent()?
readContent() is called by 3 function(s): testFullHttpRequest, testFullHttpResponse, testFullHttpResponseEOF.

Analyze Your Own Codebase

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

Try Supermodel Free