private static final class FixedRecvByteBufAllocator.HandleImpl extends java.lang.Object implements RecvByteBufAllocator.Handle
| Modifier and Type | Field and Description |
|---|---|
private int |
bufferSize |
| Constructor and Description |
|---|
HandleImpl(int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuf |
allocate(ByteBufAllocator alloc)
Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small
enough not to waste its space.
|
int |
guess()
Similar to
RecvByteBufAllocator.Handle.allocate(ByteBufAllocator) except that it does not allocate anything but just tells the
capacity. |
void |
record(int actualReadBytes)
Records the the actual number of read bytes in the previous read operation so that the allocator allocates
the buffer with potentially more correct capacity.
|
public ByteBuf allocate(ByteBufAllocator alloc)
RecvByteBufAllocator.Handleallocate in interface RecvByteBufAllocator.Handlepublic int guess()
RecvByteBufAllocator.HandleRecvByteBufAllocator.Handle.allocate(ByteBufAllocator) except that it does not allocate anything but just tells the
capacity.guess in interface RecvByteBufAllocator.Handlepublic void record(int actualReadBytes)
RecvByteBufAllocator.Handlerecord in interface RecvByteBufAllocator.HandleactualReadBytes - the actual number of read bytes in the previous read operation