Home / Function/ testForEachByte() — netty Function Reference

testForEachByte() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e02a610b_6562_923f_e758_ad96de7be327["testForEachByte()"]
  6540f2d1_cdad_6705_dd1d_9a24e2e53242["AbstractByteBufTest"]
  e02a610b_6562_923f_e758_ad96de7be327 -->|defined in| 6540f2d1_cdad_6705_dd1d_9a24e2e53242
  8a937a41_8149_af3c_cc53_a4bb2a5522fa["process()"]
  e02a610b_6562_923f_e758_ad96de7be327 -->|calls| 8a937a41_8149_af3c_cc53_a4bb2a5522fa
  style e02a610b_6562_923f_e758_ad96de7be327 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java lines 2617–2639

    @Test
    public void testForEachByte() {
        buffer.clear();
        for (int i = 0; i < CAPACITY; i ++) {
            buffer.writeByte(i + 1);
        }

        final AtomicInteger lastIndex = new AtomicInteger();
        buffer.setIndex(CAPACITY / 4, CAPACITY * 3 / 4);
        assertEquals(-1, buffer.forEachByte(new ByteProcessor() {
            int i = CAPACITY / 4;

            @Override
            public boolean process(byte value) throws Exception {
                assertEquals((byte) (i + 1), value);
                lastIndex.set(i);
                i ++;
                return true;
            }
        }));

        assertEquals(CAPACITY * 3 / 4 - 1, lastIndex.get());
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testForEachByte() do?
testForEachByte() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java.
Where is testForEachByte() defined?
testForEachByte() is defined in buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java at line 2617.
What does testForEachByte() call?
testForEachByte() calls 1 function(s): process.

Analyze Your Own Codebase

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

Try Supermodel Free