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.Handle
allocate
in interface RecvByteBufAllocator.Handle
public int guess()
RecvByteBufAllocator.Handle
RecvByteBufAllocator.Handle.allocate(ByteBufAllocator)
except that it does not allocate anything but just tells the
capacity.guess
in interface RecvByteBufAllocator.Handle
public void record(int actualReadBytes)
RecvByteBufAllocator.Handle
record
in interface RecvByteBufAllocator.Handle
actualReadBytes
- the actual number of read bytes in the previous read operation