Home / Function/ testDecodeCopyWith1ByteOffset() — netty Function Reference

testDecodeCopyWith1ByteOffset() — netty Function Reference

Architecture documentation for the testDecodeCopyWith1ByteOffset() function in SnappyTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c64dffd6_6e9a_3fe9_9e9d_3ee6b6bdc366["testDecodeCopyWith1ByteOffset()"]
  1a449087_fef9_c1b9_33e3_88b8aff8d675["SnappyTest"]
  c64dffd6_6e9a_3fe9_9e9d_3ee6b6bdc366 -->|defined in| 1a449087_fef9_c1b9_33e3_88b8aff8d675
  style c64dffd6_6e9a_3fe9_9e9d_3ee6b6bdc366 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/test/java/io/netty/handler/codec/compression/SnappyTest.java lines 61–82

    @Test
    public void testDecodeCopyWith1ByteOffset() throws Exception {
        ByteBuf in = Unpooled.wrappedBuffer(new byte[] {
            0x0a, // preamble length
            0x04 << 2, // literal tag + length
            0x6e, 0x65, 0x74, 0x74, 0x79, // "netty"
            0x01 << 2 | 0x01, // copy with 1-byte offset + length
            0x05 // offset
        });
        ByteBuf out = Unpooled.buffer(10);
        snappy.decode(in, out);

        // "nettynetty" - we saved a whole byte :)
        ByteBuf expected = Unpooled.wrappedBuffer(new byte[] {
            0x6e, 0x65, 0x74, 0x74, 0x79, 0x6e, 0x65, 0x74, 0x74, 0x79
        });
        assertEquals(expected, out, "Copy was not decoded correctly");

        in.release();
        out.release();
        expected.release();
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free