Home / Function/ testCopyingToOutputStream() — netty Function Reference

testCopyingToOutputStream() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/FixedCompositeByteBufTest.java lines 396–422

    @Test
    public void testCopyingToOutputStream() throws IOException {
        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);
        OutputStream copyStream = new ByteBufOutputStream(copy);
        OutputStream copy2Stream = new ByteBufOutputStream(copy2);
        try {
            composite.getBytes(0, copyStream, 3);
            composite.getBytes(0, copy2Stream, 3);
            assertEquals(0, ByteBufUtil.compare(copy, composite));
            assertEquals(0, ByteBufUtil.compare(copy2, composite));
            assertEquals(0, ByteBufUtil.compare(copy, copy2));
        } finally {
            copy.release();
            copy2.release();
            copyStream.close();
            copy2Stream.close();
            composite.release();
        }
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free