testSize4Varint() — netty Function Reference
Architecture documentation for the testSize4Varint() function in ProtobufVarint32LengthFieldPrependerTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD a0e8cfba_48fd_051d_1689_75f9ac061d9b["testSize4Varint()"] 6eaee290_afed_8a50_d035_25ef3cea2e1f["ProtobufVarint32LengthFieldPrependerTest"] a0e8cfba_48fd_051d_1689_75f9ac061d9b -->|defined in| 6eaee290_afed_8a50_d035_25ef3cea2e1f style a0e8cfba_48fd_051d_1689_75f9ac061d9b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-protobuf/src/test/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java lines 131–166
@Test
public void testSize4Varint() {
final int size = 4;
final int num = 0x200000;
assertEquals(size, ProtobufVarint32LengthFieldPrepender.computeRawVarint32Size(num));
final byte[] buf = new byte[size + num];
/**
* 8 0 8 0 8 0 0 1
* 1000 0000 1000 0000 1000 0000 0000 0001
* 0000 0000 0000 0000 0000 0000 0000 0001
* 0000 0001 0000 0000 0000 0000 0000 0000
* 000 0001 000 0000 000 0000 000 0000
*
* 0000 0010 0000 0000 0000 0000 0000
* 0 2 0 0 0 0 0
*
*/
buf[0] = (byte) (0x80 & 0xFF);
buf[1] = (byte) (0x80 & 0xFF);
buf[2] = (byte) (0x80 & 0xFF);
buf[3] = 0x01;
for (int i = size; i < num + size; ++i) {
buf[i] = 1;
}
assertTrue(ch.writeOutbound(wrappedBuffer(buf, size, buf.length - size)));
ByteBuf expected = wrappedBuffer(buf);
ByteBuf actual = ch.readOutbound();
assertEquals(expected, actual);
assertFalse(ch.finish());
expected.release();
actual.release();
}
Domain
Subdomains
Source
Frequently Asked Questions
What does testSize4Varint() do?
testSize4Varint() is a function in the netty codebase, defined in codec-protobuf/src/test/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java.
Where is testSize4Varint() defined?
testSize4Varint() is defined in codec-protobuf/src/test/java/io/netty/handler/codec/protobuf/ProtobufVarint32LengthFieldPrependerTest.java at line 131.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free