Home / Function/ testGetBytesByteBuffer() — netty Function Reference

testGetBytesByteBuffer() — netty Function Reference

Architecture documentation for the testGetBytesByteBuffer() function in SlicedByteBufTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  6f508445_a1c6_6ad6_0099_ac6262a4b84b["testGetBytesByteBuffer()"]
  d2003ad7_9c00_dcea_c98f_30ea8ee049f1["SlicedByteBufTest"]
  6f508445_a1c6_6ad6_0099_ac6262a4b84b -->|defined in| d2003ad7_9c00_dcea_c98f_30ea8ee049f1
  style 6f508445_a1c6_6ad6_0099_ac6262a4b84b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/SlicedByteBufTest.java lines 260–277

    @Override
    @Test
    public void testGetBytesByteBuffer() {
        byte[] bytes = {'a', 'b', 'c', 'd', 'e', 'f', 'g'};
        // Ensure destination buffer is bigger then what is wrapped in the ByteBuf.
        final ByteBuffer nioBuffer = ByteBuffer.allocate(bytes.length + 1);
        final ByteBuf wrappedBuffer = Unpooled.wrappedBuffer(bytes).slice(0, bytes.length - 1);
        try {
            assertThrows(IndexOutOfBoundsException.class, new Executable() {
                @Override
                public void execute() {
                    wrappedBuffer.getBytes(wrappedBuffer.readerIndex(), nioBuffer);
                }
            });
        } finally {
            wrappedBuffer.release();
        }
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free