Home / Function/ testCopyingToOtherBuffer() — netty Function Reference

testCopyingToOtherBuffer() — netty Function Reference

Architecture documentation for the testCopyingToOtherBuffer() function in FixedCompositeByteBufTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  67b768e8_7ecf_1cb8_6a59_96fba47f19d8["testCopyingToOtherBuffer()"]
  0580ab1c_4068_2dfc_70ec_23a7d5440016["FixedCompositeByteBufTest"]
  67b768e8_7ecf_1cb8_6a59_96fba47f19d8 -->|defined in| 0580ab1c_4068_2dfc_70ec_23a7d5440016
  style 67b768e8_7ecf_1cb8_6a59_96fba47f19d8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/FixedCompositeByteBufTest.java lines 373–394

    @Test
    public void testCopyingToOtherBuffer() {
        ByteBuf buf1 = directBuffer(10);
        ByteBuf buf2 = buffer(10);
        ByteBuf buf3 = directBuffer(10);
        buf1.writeBytes("a".getBytes(Charset.defaultCharset()));
        buf2.writeBytes("b".getBytes(Charset.defaultCharset()));
        buf3.writeBytes("c".getBytes(Charset.defaultCharset()));
        ByteBuf composite = unmodifiableBuffer(buf1, buf2, buf3);
        ByteBuf copy = directBuffer(3);
        ByteBuf copy2 = buffer(3);
        copy.setBytes(0, composite, 0, 3);
        copy2.setBytes(0, composite, 0, 3);
        copy.writerIndex(3);
        copy2.writerIndex(3);
        assertEquals(0, ByteBufUtil.compare(copy, composite));
        assertEquals(0, ByteBufUtil.compare(copy2, composite));
        assertEquals(0, ByteBufUtil.compare(copy, copy2));
        copy.release();
        copy2.release();
        composite.release();
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free