Home / Function/ testReleaseOnCloseInByteBufOutputStream() — netty Function Reference

testReleaseOnCloseInByteBufOutputStream() — netty Function Reference

Architecture documentation for the testReleaseOnCloseInByteBufOutputStream() function in ByteBufStreamTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f8bba961_a66c_3b4e_300c_d574e6c5e9dd["testReleaseOnCloseInByteBufOutputStream()"]
  a5486ee2_8de3_00d9_5697_f3849d26246a["ByteBufStreamTest"]
  f8bba961_a66c_3b4e_300c_d574e6c5e9dd -->|defined in| a5486ee2_8de3_00d9_5697_f3849d26246a
  style f8bba961_a66c_3b4e_300c_d574e6c5e9dd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/ByteBufStreamTest.java lines 303–321

    @Test
    public void testReleaseOnCloseInByteBufOutputStream() throws Exception {
        ByteBuf buf = PooledByteBufAllocator.DEFAULT.buffer(16);
        buf.writeBytes(new byte[] { 1, 2, 3, 4, 5, 6 });
        ByteBufOutputStream out = new ByteBufOutputStream(buf, true);
        try {
            out.writeBoolean(true);
            out.writeBoolean(false);
            out.writeByte(42);
            out.writeByte(224);
            out.writeBytes("Hello, World!");
            out.write(new byte[]{1, 3, 3, 4}, 0, 0);
        } finally {
            out.close();
        }
        // When releaseOnClose is set to true, ByteBuf will be automatically released after calling the close method of
        // ByteBufOutputStream.
        assertEquals(0, out.buffer().refCnt());
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free