Home / Function/ testRandomHeapBufferTransfer2() — netty Function Reference

testRandomHeapBufferTransfer2() — netty Function Reference

Architecture documentation for the testRandomHeapBufferTransfer2() function in AbstractByteBufTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2d1306ba_4f4f_4457_6889_24f20da2f49d["testRandomHeapBufferTransfer2()"]
  6540f2d1_cdad_6705_dd1d_9a24e2e53242["AbstractByteBufTest"]
  2d1306ba_4f4f_4457_6889_24f20da2f49d -->|defined in| 6540f2d1_cdad_6705_dd1d_9a24e2e53242
  style 2d1306ba_4f4f_4457_6889_24f20da2f49d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java lines 1482–1502

    @Test
    public void testRandomHeapBufferTransfer2() {
        byte[] valueContent = new byte[BLOCK_SIZE * 2];
        ByteBuf value = wrappedBuffer(valueContent);
        for (int i = 0; i < buffer.capacity() - BLOCK_SIZE + 1; i += BLOCK_SIZE) {
            random.nextBytes(valueContent);
            buffer.setBytes(i, value, random.nextInt(BLOCK_SIZE), BLOCK_SIZE);
        }

        random.setSeed(seed);
        byte[] expectedValueContent = new byte[BLOCK_SIZE * 2];
        ByteBuf expectedValue = wrappedBuffer(expectedValueContent);
        for (int i = 0; i < buffer.capacity() - BLOCK_SIZE + 1; i += BLOCK_SIZE) {
            random.nextBytes(expectedValueContent);
            int valueOffset = random.nextInt(BLOCK_SIZE);
            buffer.getBytes(i, value, valueOffset, BLOCK_SIZE);
            for (int j = valueOffset; j < valueOffset + BLOCK_SIZE; j ++) {
                assertEquals(expectedValue.getByte(j), value.getByte(j));
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testRandomHeapBufferTransfer2() do?
testRandomHeapBufferTransfer2() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java.
Where is testRandomHeapBufferTransfer2() defined?
testRandomHeapBufferTransfer2() is defined in buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java at line 1482.

Analyze Your Own Codebase

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

Try Supermodel Free