Package org.jboss.netty.channel
Class FixedReceiveBufferSizePredictor
- java.lang.Object
-
- org.jboss.netty.channel.FixedReceiveBufferSizePredictor
-
- All Implemented Interfaces:
ReceiveBufferSizePredictor
public class FixedReceiveBufferSizePredictor extends java.lang.Object implements ReceiveBufferSizePredictor
TheReceiveBufferSizePredictorthat always yields the same buffer size prediction. This predictor ignores the feed back from the I/O thread.
-
-
Field Summary
Fields Modifier and Type Field Description private intbufferSize
-
Constructor Summary
Constructors Constructor Description FixedReceiveBufferSizePredictor(int bufferSize)Creates a new predictor that always returns the same prediction of the specified buffer size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intnextReceiveBufferSize()Predicts the capacity of theChannelBufferfor the next read operation depending on the actual number of read bytes in the previous read operation.voidpreviousReceiveBufferSize(int previousReceiveBufferSize)Updates this predictor by specifying the actual number of read bytes in the previous read operation.
-
-
-
Method Detail
-
nextReceiveBufferSize
public int nextReceiveBufferSize()
Description copied from interface:ReceiveBufferSizePredictorPredicts the capacity of theChannelBufferfor the next read operation depending on the actual number of read bytes in the previous read operation.- Specified by:
nextReceiveBufferSizein interfaceReceiveBufferSizePredictor- Returns:
- the expected number of readable bytes this time
-
previousReceiveBufferSize
public void previousReceiveBufferSize(int previousReceiveBufferSize)
Description copied from interface:ReceiveBufferSizePredictorUpdates this predictor by specifying the actual number of read bytes in the previous read operation.- Specified by:
previousReceiveBufferSizein interfaceReceiveBufferSizePredictor- Parameters:
previousReceiveBufferSize- the actual number of read bytes in the previous read operation
-
-