public interface ReceiveBufferSizePredictor
Channel
.
It calculates the close-to-optimal capacity of the ChannelBuffer
for the next read operation depending on the actual number of read bytes
in the previous read operation. More accurate the prediction is, more
effective the memory utilization will be.
Once a read operation is performed and the actual number of read bytes is
known, an I/O thread will call previousReceiveBufferSize(int)
to
update the predictor so it can predict more accurately next time.
Modifier and Type | Method and Description |
---|---|
int |
nextReceiveBufferSize()
Predicts the capacity of the
ChannelBuffer for the next
read operation depending on the actual number of read bytes in the
previous read operation. |
void |
previousReceiveBufferSize(int previousReceiveBufferSize)
Updates this predictor by specifying the actual number of read bytes
in the previous read operation.
|
int nextReceiveBufferSize()
ChannelBuffer
for the next
read operation depending on the actual number of read bytes in the
previous read operation.void previousReceiveBufferSize(int previousReceiveBufferSize)
previousReceiveBufferSize
- the actual number of read bytes in the previous read operationCopyright © 2008-2014 The Netty Project. All Rights Reserved.