Home / Function/ EmbeddedChannel() — netty Function Reference

EmbeddedChannel() — netty Function Reference

Architecture documentation for the EmbeddedChannel() function in DelegatingDecompressorFrameListener.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  bcf5a5ca_62ae_c13a_7d3b_1d6332684fde["EmbeddedChannel()"]
  5c336d64_231e_fffd_78be_6ce616e9bc8c["DelegatingDecompressorFrameListener"]
  bcf5a5ca_62ae_c13a_7d3b_1d6332684fde -->|defined in| 5c336d64_231e_fffd_78be_6ce616e9bc8c
  style bcf5a5ca_62ae_c13a_7d3b_1d6332684fde fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java lines 167–214

    protected EmbeddedChannel newContentDecompressor(final ChannelHandlerContext ctx, CharSequence contentEncoding)
            throws Http2Exception {
        Channel channel = ctx.channel();
        if (GZIP.contentEqualsIgnoreCase(contentEncoding) || X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
            return EmbeddedChannel.builder()
                    .channelId(channel.id())
                    .hasDisconnect(channel.metadata().hasDisconnect())
                    .config(channel.config())
                    .handlers(ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP, maxAllocation))
                    .build();
        }
        if (DEFLATE.contentEqualsIgnoreCase(contentEncoding) || X_DEFLATE.contentEqualsIgnoreCase(contentEncoding)) {
            final ZlibWrapper wrapper = strict ? ZlibWrapper.ZLIB : ZlibWrapper.ZLIB_OR_NONE;
            // To be strict, 'deflate' means ZLIB, but some servers were not implemented correctly.
            return EmbeddedChannel.builder()
                    .channelId(channel.id())
                    .hasDisconnect(channel.metadata().hasDisconnect())
                    .config(channel.config())
                    .handlers(ZlibCodecFactory.newZlibDecoder(wrapper, maxAllocation))
                    .build();
        }
        if (Brotli.isAvailable() && BR.contentEqualsIgnoreCase(contentEncoding)) {
            return EmbeddedChannel.builder()
                    .channelId(channel.id())
                    .hasDisconnect(channel.metadata().hasDisconnect())
                    .config(channel.config())
                    .handlers(new BrotliDecoder())
                    .build();
        }
        if (SNAPPY.contentEqualsIgnoreCase(contentEncoding)) {
            return EmbeddedChannel.builder()
                    .channelId(channel.id())
                    .hasDisconnect(channel.metadata().hasDisconnect())
                    .config(channel.config())
                    .handlers(new SnappyFrameDecoder())
                    .build();
        }
        if (Zstd.isAvailable() && ZSTD.contentEqualsIgnoreCase(contentEncoding)) {
            return EmbeddedChannel.builder()
                    .channelId(channel.id())
                    .hasDisconnect(channel.metadata().hasDisconnect())
                    .config(channel.config())
                    .handlers(new ZstdDecoder())
                    .build();
        }
        // 'identity' or unsupported
        return null;
    }

Domain

Subdomains

Frequently Asked Questions

What does EmbeddedChannel() do?
EmbeddedChannel() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java.
Where is EmbeddedChannel() defined?
EmbeddedChannel() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingDecompressorFrameListener.java at line 167.

Analyze Your Own Codebase

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

Try Supermodel Free