Package org.jboss.netty.channel
Class FixedReceiveBufferSizePredictor
java.lang.Object
org.jboss.netty.channel.FixedReceiveBufferSizePredictor
- All Implemented Interfaces:
ReceiveBufferSizePredictor
The
ReceiveBufferSizePredictor
that always yields the same buffer
size prediction. This predictor ignores the feed back from the I/O thread.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFixedReceiveBufferSizePredictor
(int bufferSize) Creates a new predictor that always returns the same prediction of the specified buffer size. -
Method Summary
Modifier and TypeMethodDescriptionint
Predicts the capacity of theChannelBuffer
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.
-
Field Details
-
bufferSize
private final int bufferSize
-
-
Constructor Details
-
FixedReceiveBufferSizePredictor
public FixedReceiveBufferSizePredictor(int bufferSize) Creates a new predictor that always returns the same prediction of the specified buffer size.
-
-
Method Details
-
nextReceiveBufferSize
public int nextReceiveBufferSize()Description copied from interface:ReceiveBufferSizePredictor
Predicts the capacity of theChannelBuffer
for the next read operation depending on the actual number of read bytes in the previous read operation.- Specified by:
nextReceiveBufferSize
in interfaceReceiveBufferSizePredictor
- Returns:
- the expected number of readable bytes this time
-
previousReceiveBufferSize
public void previousReceiveBufferSize(int previousReceiveBufferSize) Description copied from interface:ReceiveBufferSizePredictor
Updates this predictor by specifying the actual number of read bytes in the previous read operation.- Specified by:
previousReceiveBufferSize
in interfaceReceiveBufferSizePredictor
- Parameters:
previousReceiveBufferSize
- the actual number of read bytes in the previous read operation
-