Home / Function/ ByteBuf() — netty Function Reference

ByteBuf() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b315a9b8_b458_0caf_cc38_65804a77ebf4["ByteBuf()"]
  c729df56_e52a_35d9_ae50_4104aa9af83d["ZstdEncoderTest"]
  b315a9b8_b458_0caf_cc38_65804a77ebf4 -->|defined in| c729df56_e52a_35d9_ae50_4104aa9af83d
  style b315a9b8_b458_0caf_cc38_65804a77ebf4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-compression/src/test/java/io/netty/handler/codec/compression/ZstdEncoderTest.java lines 112–130

    @Override
    protected ByteBuf decompress(ByteBuf compressed, int originalLength) throws Exception {
        byte[] decompressed = new byte[originalLength];
        try (ZstdInputStream zstdIs = new ZstdInputStream(new ByteBufInputStream(compressed, true))) {

            int remaining = originalLength;
            while (remaining > 0) {
                int read = zstdIs.read(decompressed, originalLength - remaining, remaining);
                if (read > 0) {
                    remaining -= read;
                } else {
                    break;
                }
            }
            assertEquals(-1, zstdIs.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/ZstdEncoderTest.java.
Where is ByteBuf() defined?
ByteBuf() is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/ZstdEncoderTest.java at line 112.

Analyze Your Own Codebase

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

Try Supermodel Free