Home / Function/ testFragmentedGzipStreamStillYieldsCorrectContent() — netty Function Reference

testFragmentedGzipStreamStillYieldsCorrectContent() — netty Function Reference

Architecture documentation for the testFragmentedGzipStreamStillYieldsCorrectContent() function in JdkZlibTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  275242ad_b326_0d1b_a62e_be655f385e9f["testFragmentedGzipStreamStillYieldsCorrectContent()"]
  4c83b538_e9fd_3b12_c32e_629bfd12e1ce["JdkZlibTest"]
  275242ad_b326_0d1b_a62e_be655f385e9f -->|defined in| 4c83b538_e9fd_3b12_c32e_629bfd12e1ce
  style 275242ad_b326_0d1b_a62e_be655f385e9f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/test/java/io/netty/handler/codec/compression/JdkZlibTest.java lines 276–303

    @Test
    public void testFragmentedGzipStreamStillYieldsCorrectContent() throws Exception {
        String text = "Fragmented input stream for GZIP!";
        byte[] input = text.getBytes(CharsetUtil.UTF_8);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        GZIPOutputStream gzipOut = new GZIPOutputStream(baos);
        gzipOut.write(input);
        gzipOut.close();
        byte[] compressed = baos.toByteArray();

        EmbeddedChannel decoder = new EmbeddedChannel(new JdkZlibDecoder(ZlibWrapper.GZIP, Integer.MAX_VALUE));

        for (byte b : compressed) {
            decoder.writeInbound(Unpooled.wrappedBuffer(new byte[]{ b }));
        }
        assertTrue(decoder.finish());

        ByteBuf result = Unpooled.buffer();
        ByteBuf chunk;
        while ((chunk = decoder.readInbound()) != null) {
            result.writeBytes(chunk);
            chunk.release();
        }

        assertEquals(text, result.toString(CharsetUtil.UTF_8));
        result.release();
    }

Domain

Subdomains

Frequently Asked Questions

What does testFragmentedGzipStreamStillYieldsCorrectContent() do?
testFragmentedGzipStreamStillYieldsCorrectContent() is a function in the netty codebase, defined in codec-compression/src/test/java/io/netty/handler/codec/compression/JdkZlibTest.java.
Where is testFragmentedGzipStreamStillYieldsCorrectContent() defined?
testFragmentedGzipStreamStillYieldsCorrectContent() is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/JdkZlibTest.java at line 276.

Analyze Your Own Codebase

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

Try Supermodel Free