Home / Function/ ByteBufAllocator() — netty Function Reference

ByteBufAllocator() — netty Function Reference

Architecture documentation for the ByteBufAllocator() function in QuicChannelEchoTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  65e9b173_6f62_0379_ba24_96242023fcee["ByteBufAllocator()"]
  949dbf36_222b_a1d5_95aa_68ae528fcaf5["QuicChannelEchoTest"]
  65e9b173_6f62_0379_ba24_96242023fcee -->|defined in| 949dbf36_222b_a1d5_95aa_68ae528fcaf5
  style 65e9b173_6f62_0379_ba24_96242023fcee fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelEchoTest.java lines 74–112

    private ByteBufAllocator getAllocator(boolean directBuffer) {
        if (directBuffer) {
            return new UnpooledByteBufAllocator(true);
        } else {
            // Force usage of heap buffers and also ensure memoryAddress() is not not supported.
            return new AbstractByteBufAllocator(false) {

                @Override
                public ByteBuf ioBuffer() {
                    return heapBuffer();
                }

                @Override
                public ByteBuf ioBuffer(int initialCapacity) {
                    return heapBuffer(initialCapacity);
                }

                @Override
                public ByteBuf ioBuffer(int initialCapacity, int maxCapacity) {
                    return heapBuffer(initialCapacity, maxCapacity);
                }

                @Override
                protected ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity) {
                    return new UnpooledHeapByteBuf(this, initialCapacity, maxCapacity);
                }

                @Override
                protected ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity) {
                    return new UnpooledDirectByteBuf(this, initialCapacity, maxCapacity);
                }

                @Override
                public boolean isDirectBufferPooled() {
                    return false;
                }
            };
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does ByteBufAllocator() do?
ByteBufAllocator() is a function in the netty codebase, defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelEchoTest.java.
Where is ByteBufAllocator() defined?
ByteBufAllocator() is defined in codec-native-quic/src/test/java/io/netty/handler/codec/quic/QuicChannelEchoTest.java at line 74.

Analyze Your Own Codebase

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

Try Supermodel Free