Alloc Class — netty Architecture
Architecture documentation for the Alloc class in HttpRequestResponseBenchmark.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD ee1d7f14_7de7_6d4f_4a74_78e63145b0d1["Alloc"] c0f7ef6d_b666_8405_5cb9_2920f68ad32e["HttpRequestResponseBenchmark.java"] ee1d7f14_7de7_6d4f_4a74_78e63145b0d1 -->|defined in| c0f7ef6d_b666_8405_5cb9_2920f68ad32e 879db0a6_2b54_7768_fa73_763476922d32["ByteBuf()"] ee1d7f14_7de7_6d4f_4a74_78e63145b0d1 -->|method| 879db0a6_2b54_7768_fa73_763476922d32 6dbda1eb_0bd6_e1d9_f2c1_9a9530562c1f["CompositeByteBuf()"] ee1d7f14_7de7_6d4f_4a74_78e63145b0d1 -->|method| 6dbda1eb_0bd6_e1d9_f2c1_9a9530562c1f 8a3ee81d_92cb_a60c_f5b2_801baf7bccc9["isDirectBufferPooled()"] ee1d7f14_7de7_6d4f_4a74_78e63145b0d1 -->|method| 8a3ee81d_92cb_a60c_f5b2_801baf7bccc9 a4177258_01a6_208e_753c_5ecdb624d5b6["calculateNewCapacity()"] ee1d7f14_7de7_6d4f_4a74_78e63145b0d1 -->|method| a4177258_01a6_208e_753c_5ecdb624d5b6
Relationship Graph
Source Code
microbench/src/main/java/io/netty/microbench/http/HttpRequestResponseBenchmark.java lines 69–182
static class Alloc implements ByteBufAllocator {
private final ByteBuf buf = Unpooled.buffer();
private final int capacity = buf.capacity();
@Override
public ByteBuf buffer() {
buf.clear();
return buf;
}
@Override
public ByteBuf buffer(int initialCapacity) {
if (initialCapacity <= capacity) {
return buffer();
} else {
throw new IllegalArgumentException();
}
}
@Override
public ByteBuf buffer(int initialCapacity, int maxCapacity) {
if (initialCapacity <= capacity) {
return buffer();
} else {
throw new IllegalArgumentException();
}
}
@Override
public ByteBuf ioBuffer() {
throw new UnsupportedOperationException();
}
@Override
public ByteBuf ioBuffer(int initialCapacity) {
throw new UnsupportedOperationException();
}
@Override
public ByteBuf ioBuffer(int initialCapacity, int maxCapacity) {
throw new UnsupportedOperationException();
}
@Override
public ByteBuf heapBuffer() {
throw new UnsupportedOperationException();
}
@Override
public ByteBuf heapBuffer(int initialCapacity) {
throw new UnsupportedOperationException();
}
@Override
public ByteBuf heapBuffer(int initialCapacity, int maxCapacity) {
throw new UnsupportedOperationException();
}
@Override
public ByteBuf directBuffer() {
throw new UnsupportedOperationException();
}
@Override
public ByteBuf directBuffer(int initialCapacity) {
throw new UnsupportedOperationException();
}
@Override
public ByteBuf directBuffer(int initialCapacity, int maxCapacity) {
throw new UnsupportedOperationException();
}
@Override
public CompositeByteBuf compositeBuffer() {
throw new UnsupportedOperationException();
}
@Override
public CompositeByteBuf compositeBuffer(int maxNumComponents) {
Source
Frequently Asked Questions
What is the Alloc class?
Alloc is a class in the netty codebase, defined in microbench/src/main/java/io/netty/microbench/http/HttpRequestResponseBenchmark.java.
Where is Alloc defined?
Alloc is defined in microbench/src/main/java/io/netty/microbench/http/HttpRequestResponseBenchmark.java at line 69.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free