Home / Function/ testDecodeLiteral() — netty Function Reference

testDecodeLiteral() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

codec-compression/src/test/java/io/netty/handler/codec/compression/SnappyTest.java lines 40–59

    @Test
    public void testDecodeLiteral() throws Exception {
        ByteBuf in = Unpooled.wrappedBuffer(new byte[] {
            0x05, // preamble length
            0x04 << 2, // literal tag + length
            0x6e, 0x65, 0x74, 0x74, 0x79 // "netty"
        });
        ByteBuf out = Unpooled.buffer(5);
        snappy.decode(in, out);

        // "netty"
        ByteBuf expected = Unpooled.wrappedBuffer(new byte[] {
            0x6e, 0x65, 0x74, 0x74, 0x79
        });
        assertEquals(expected, out, "Literal was not decoded correctly");

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

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free