TestByteBufAllocator Class — netty Architecture
Architecture documentation for the TestByteBufAllocator class in ZlibTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD ecd184c4_a4e3_af0d_27ca_4e2071a5683a["TestByteBufAllocator"] 0d77c5c0_96fa_b31e_7432_859b57783ef6["ZlibTest.java"] ecd184c4_a4e3_af0d_27ca_4e2071a5683a -->|defined in| 0d77c5c0_96fa_b31e_7432_859b57783ef6 b4882686_ed02_4fb8_dc30_f56b2f5f3260["TestByteBufAllocator()"] ecd184c4_a4e3_af0d_27ca_4e2071a5683a -->|method| b4882686_ed02_4fb8_dc30_f56b2f5f3260 cdfad5d4_ebf7_7515_1b3b_23c3d5af6fe9["getMaxAllocation()"] ecd184c4_a4e3_af0d_27ca_4e2071a5683a -->|method| cdfad5d4_ebf7_7515_1b3b_23c3d5af6fe9 c4cceb13_dab4_f21b_0242_54dc5769564b["isDirectBufferPooled()"] ecd184c4_a4e3_af0d_27ca_4e2071a5683a -->|method| c4cceb13_dab4_f21b_0242_54dc5769564b 7fa30b1b_5e6f_8f39_d989_a55d8a41c2d6["ByteBuf()"] ecd184c4_a4e3_af0d_27ca_4e2071a5683a -->|method| 7fa30b1b_5e6f_8f39_d989_a55d8a41c2d6
Relationship Graph
Source Code
codec-compression/src/test/java/io/netty/handler/codec/compression/ZlibTest.java lines 447–475
private static final class TestByteBufAllocator extends AbstractByteBufAllocator {
private final ByteBufAllocator wrapped;
private int maxAllocation;
TestByteBufAllocator(ByteBufAllocator wrapped) {
this.wrapped = wrapped;
}
public int getMaxAllocation() {
return maxAllocation;
}
@Override
public boolean isDirectBufferPooled() {
return wrapped.isDirectBufferPooled();
}
@Override
protected ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity) {
maxAllocation = Math.max(maxAllocation, maxCapacity);
return wrapped.heapBuffer(initialCapacity, maxCapacity);
}
@Override
protected ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity) {
maxAllocation = Math.max(maxAllocation, maxCapacity);
return wrapped.directBuffer(initialCapacity, maxCapacity);
}
}
Source
Frequently Asked Questions
What is the TestByteBufAllocator class?
TestByteBufAllocator is a class in the netty codebase, defined in codec-compression/src/test/java/io/netty/handler/codec/compression/ZlibTest.java.
Where is TestByteBufAllocator defined?
TestByteBufAllocator is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/ZlibTest.java at line 447.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free