LimitedByteBufAllocator Class — netty Architecture
Architecture documentation for the LimitedByteBufAllocator class in JdkZlibTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD e9b4feec_683c_9548_9483_c4ed5077195d["LimitedByteBufAllocator"] 18223982_070f_3c52_1182_04458ee30af1["JdkZlibTest.java"] e9b4feec_683c_9548_9483_c4ed5077195d -->|defined in| 18223982_070f_3c52_1182_04458ee30af1 92a13212_51ac_5e91_5e2b_fbaccf2455fa["LimitedByteBufAllocator()"] e9b4feec_683c_9548_9483_c4ed5077195d -->|method| 92a13212_51ac_5e91_5e2b_fbaccf2455fa 47620c77_68e4_2ff4_b1b1_122a8cb25e70["isDirectBufferPooled()"] e9b4feec_683c_9548_9483_c4ed5077195d -->|method| 47620c77_68e4_2ff4_b1b1_122a8cb25e70 4ac4f2a3_3631_f8d1_9560_59d93def812f["ByteBuf()"] e9b4feec_683c_9548_9483_c4ed5077195d -->|method| 4ac4f2a3_3631_f8d1_9560_59d93def812f
Relationship Graph
Source Code
codec-compression/src/test/java/io/netty/handler/codec/compression/JdkZlibTest.java lines 341–364
private static final class LimitedByteBufAllocator extends AbstractByteBufAllocator {
private static final int MAX = 1024 * 1024;
private final ByteBufAllocator wrapped;
LimitedByteBufAllocator(ByteBufAllocator wrapped) {
this.wrapped = wrapped;
}
@Override
public boolean isDirectBufferPooled() {
return wrapped.isDirectBufferPooled();
}
@Override
protected ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity) {
return wrapped.heapBuffer(initialCapacity, Math.min(maxCapacity, MAX));
}
@Override
protected ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity) {
return wrapped.directBuffer(initialCapacity, Math.min(maxCapacity, MAX));
}
}
Source
Frequently Asked Questions
What is the LimitedByteBufAllocator class?
LimitedByteBufAllocator is a class in the netty codebase, defined in codec-compression/src/test/java/io/netty/handler/codec/compression/JdkZlibTest.java.
Where is LimitedByteBufAllocator defined?
LimitedByteBufAllocator is defined in codec-compression/src/test/java/io/netty/handler/codec/compression/JdkZlibTest.java at line 341.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free