Home / Function/ gzDecompress() — netty Function Reference

gzDecompress() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  990eb8f7_f8c4_a14d_0b4f_64b2e9693297["gzDecompress()"]
  ea4ec426_b689_ab52_a554_7959aed6c709["HttpContentDecoderTest"]
  990eb8f7_f8c4_a14d_0b4f_64b2e9693297 -->|defined in| ea4ec426_b689_ab52_a554_7959aed6c709
  14854d12_c5f6_6934_ec39_441b8a359663["testBinaryDecompression()"]
  14854d12_c5f6_6934_ec39_441b8a359663 -->|calls| 990eb8f7_f8c4_a14d_0b4f_64b2e9693297
  style 990eb8f7_f8c4_a14d_0b4f_64b2e9693297 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java lines 824–848

    private static byte[] gzDecompress(byte[] input) {
        ZlibDecoder decoder = ZlibCodecFactory.newZlibDecoder(ZlibWrapper.GZIP, 0);
        EmbeddedChannel channel = new EmbeddedChannel(decoder);
        assertTrue(channel.writeInbound(Unpooled.copiedBuffer(input)));
        assertTrue(channel.finish()); // close the channel to indicate end-of-data

        int outputSize = 0;
        ByteBuf o;
        List<ByteBuf> inbound = new ArrayList<ByteBuf>();
        while ((o = channel.readInbound()) != null) {
            inbound.add(o);
            outputSize += o.readableBytes();
        }

        byte[] output = new byte[outputSize];
        int readCount = 0;
        for (ByteBuf b : inbound) {
            int readableBytes = b.readableBytes();
            b.readBytes(output, readCount, readableBytes);
            b.release();
            readCount += readableBytes;
        }
        assertTrue(channel.inboundMessages().isEmpty() && channel.outboundMessages().isEmpty());
        return output;
    }

Domain

Subdomains

Frequently Asked Questions

What does gzDecompress() do?
gzDecompress() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java.
Where is gzDecompress() defined?
gzDecompress() is defined in codec-http/src/test/java/io/netty/handler/codec/http/HttpContentDecoderTest.java at line 824.
What calls gzDecompress()?
gzDecompress() is called by 1 function(s): testBinaryDecompression.

Analyze Your Own Codebase

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

Try Supermodel Free