testEncodeLiteralAndDecodeLiteral() — netty Function Reference
Architecture documentation for the testEncodeLiteralAndDecodeLiteral() function in SnappyTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD ac7399f9_c466_ca76_a8b0_a11039093c26["testEncodeLiteralAndDecodeLiteral()"] 1a449087_fef9_c1b9_33e3_88b8aff8d675["SnappyTest"] ac7399f9_c466_ca76_a8b0_a11039093c26 -->|defined in| 1a449087_fef9_c1b9_33e3_88b8aff8d675 style ac7399f9_c466_ca76_a8b0_a11039093c26 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-compression/src/test/java/io/netty/handler/codec/compression/SnappyTest.java lines 298–324
@Test
public void testEncodeLiteralAndDecodeLiteral() {
int[] lengths = {
0x11, // default
0x100, // case 60
0x1000, // case 61
0x100000, // case 62
0x1000001 // case 63
};
for (int len : lengths) {
ByteBuf in = Unpooled.wrappedBuffer(new byte[len]);
ByteBuf encoded = Unpooled.buffer(10);
ByteBuf decoded = Unpooled.buffer(10);
ByteBuf expected = Unpooled.wrappedBuffer(new byte[len]);
try {
encodeLiteral(in, encoded, len);
byte tag = encoded.readByte();
decodeLiteral(tag, encoded, decoded);
assertEquals(expected, decoded, "Encoded or decoded literal was incorrect");
} finally {
in.release();
encoded.release();
decoded.release();
expected.release();
}
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testEncodeLiteralAndDecodeLiteral() do?
testEncodeLiteralAndDecodeLiteral() is a function in the netty codebase, defined in codec-compression/src/test/java/io/netty/handler/codec/compression/SnappyTest.java.
Where is testEncodeLiteralAndDecodeLiteral() defined?
testEncodeLiteralAndDecodeLiteral() is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/SnappyTest.java at line 298.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free