Home / Function/ ByteBuf() — netty Function Reference

ByteBuf() — netty Function Reference

Architecture documentation for the ByteBuf() function in Bzip2EncoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  e41cb9e9_1f04_09fc_b7d5_e34fcbdeeff9["ByteBuf()"]
  002913a8_b807_e35a_3fcd_63568dbb8146["Bzip2EncoderTest"]
  e41cb9e9_1f04_09fc_b7d5_e34fcbdeeff9 -->|defined in| 002913a8_b807_e35a_3fcd_63568dbb8146
  style e41cb9e9_1f04_09fc_b7d5_e34fcbdeeff9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2EncoderTest.java lines 36–56

    @Override
    protected ByteBuf decompress(ByteBuf compressed, int originalLength) throws Exception {

        byte[] decompressed = new byte[originalLength];
        try (InputStream is = new ByteBufInputStream(compressed, true);
             BZip2CompressorInputStream bzip2Is = new BZip2CompressorInputStream(is)) {

            int remaining = originalLength;
            while (remaining > 0) {
                int read = bzip2Is.read(decompressed, originalLength - remaining, remaining);
                if (read > 0) {
                    remaining -= read;
                } else {
                    break;
                }
            }
            assertEquals(-1, bzip2Is.read());
        }

        return Unpooled.wrappedBuffer(decompressed);
    }

Domain

Subdomains

Frequently Asked Questions

What does ByteBuf() do?
ByteBuf() is a function in the netty codebase, defined in codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2EncoderTest.java.
Where is ByteBuf() defined?
ByteBuf() is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/Bzip2EncoderTest.java at line 36.

Analyze Your Own Codebase

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

Try Supermodel Free