Home / Function/ testDecodeWithHeaderFollowingFooter() — netty Function Reference

testDecodeWithHeaderFollowingFooter() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

codec-compression/src/test/java/io/netty/handler/codec/compression/JdkZlibTest.java lines 143–172

    @Test
    public void testDecodeWithHeaderFollowingFooter() throws Exception {
        byte[] bytes = new byte[1024];
        ThreadLocalRandom.current().nextBytes(bytes);
        ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
        GZIPOutputStream out = new GZIPOutputStream(bytesOut);
        out.write(bytes);
        out.close();

        byte[] compressed = bytesOut.toByteArray();
        ByteBuf buffer = Unpooled.buffer().writeBytes(compressed).writeBytes(compressed);
        EmbeddedChannel channel = new EmbeddedChannel(new JdkZlibDecoder(ZlibWrapper.GZIP, true, 0));
        // Write it into the Channel in a way that we were able to decompress the first data completely but not the
        // whole footer.
        assertTrue(channel.writeInbound(buffer.readRetainedSlice(compressed.length - 1)));
        assertTrue(channel.writeInbound(buffer));
        assertTrue(channel.finish());

        ByteBuf uncompressedBuffer = Unpooled.wrappedBuffer(bytes);
        ByteBuf read = channel.readInbound();
        assertEquals(uncompressedBuffer, read);
        read.release();

        read = channel.readInbound();
        assertEquals(uncompressedBuffer, read);
        read.release();

        assertNull(channel.readInbound());
        uncompressedBuffer.release();
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free