Home / Function/ Result() — netty Function Reference

Result() — netty Function Reference

Architecture documentation for the Result() function in HttpContentCompressor.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  058c003d_0fca_6751_f708_16e9fee143d4["Result()"]
  1a373d52_2146_2610_7650_6b487cdcefae["HttpContentCompressor"]
  058c003d_0fca_6751_f708_16e9fee143d4 -->|defined in| 1a373d52_2146_2610_7650_6b487cdcefae
  93c84887_466a_4f4a_7fbd_608fea920e34["createEncoderFor()"]
  058c003d_0fca_6751_f708_16e9fee143d4 -->|calls| 93c84887_466a_4f4a_7fbd_608fea920e34
  style 058c003d_0fca_6751_f708_16e9fee143d4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java lines 251–280

    @Override
    protected Result beginEncode(HttpResponse httpResponse, String acceptEncoding) throws Exception {
        if (this.contentSizeThreshold > 0) {
            if (httpResponse instanceof HttpContent &&
                    ((HttpContent) httpResponse).content().readableBytes() < contentSizeThreshold) {
                return null;
            }
        }

        String contentEncoding = httpResponse.headers().get(HttpHeaderNames.CONTENT_ENCODING);
        if (contentEncoding != null) {
            // Content-Encoding was set, either as something specific or as the IDENTITY encoding
            // Therefore, we should NOT encode here
            return null;
        }

        String targetContentEncoding = determineEncoding(acceptEncoding);
        if (targetContentEncoding == null) {
            return null;
        }

        Channel channel = ctx.channel();
        return new Result(targetContentEncoding,
                EmbeddedChannel.builder()
                        .channelId(channel.id())
                        .hasDisconnect(channel.metadata().hasDisconnect())
                        .config(channel.config())
                        .handlers(createEncoderFor(targetContentEncoding))
                        .build());
    }

Subdomains

Frequently Asked Questions

What does Result() do?
Result() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java.
Where is Result() defined?
Result() is defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java at line 251.
What does Result() call?
Result() calls 1 function(s): createEncoderFor.

Analyze Your Own Codebase

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

Try Supermodel Free