Home / Function/ testGetBytesByteBuffer() — netty Function Reference

testGetBytesByteBuffer() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8120934a_2090_4d8e_38aa_6337bdb614c2["testGetBytesByteBuffer()"]
  2436e747_1306_235e_86df_d12765b22d51["ReadOnlyDirectByteBufferBufTest"]
  8120934a_2090_4d8e_38aa_6337bdb614c2 -->|defined in| 2436e747_1306_235e_86df_d12765b22d51
  style 8120934a_2090_4d8e_38aa_6337bdb614c2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/ReadOnlyDirectByteBufferBufTest.java lines 316–333

    @Test
    public void testGetBytesByteBuffer() {
        byte[] bytes = {'a', 'b', 'c', 'd', 'e', 'f', 'g'};
        // Ensure destination buffer is bigger then what is in the ByteBuf.
        final ByteBuffer nioBuffer = ByteBuffer.allocate(bytes.length + 1);
        final ByteBuf buffer = buffer(((ByteBuffer) allocate(bytes.length)
                .put(bytes).flip()).asReadOnlyBuffer());
        try {
            assertThrows(IndexOutOfBoundsException.class, new Executable() {
                @Override
                public void execute() {
                    buffer.getBytes(buffer.readerIndex(), nioBuffer);
                }
            });
        } finally {
            buffer.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/ReadOnlyDirectByteBufferBufTest.java.
Where is testGetBytesByteBuffer() defined?
testGetBytesByteBuffer() is defined in buffer/src/test/java/io/netty/buffer/ReadOnlyDirectByteBufferBufTest.java at line 316.

Analyze Your Own Codebase

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

Try Supermodel Free