Package io.netty.channel
Class FixedRecvByteBufAllocator
- java.lang.Object
-
- io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator
-
- io.netty.channel.FixedRecvByteBufAllocator
-
- All Implemented Interfaces:
MaxMessagesRecvByteBufAllocator
,RecvByteBufAllocator
public class FixedRecvByteBufAllocator extends DefaultMaxMessagesRecvByteBufAllocator
TheRecvByteBufAllocator
that always yields the same buffer size prediction. This predictor ignores the feed back from the I/O thread.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator
DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
-
Nested classes/interfaces inherited from interface io.netty.channel.RecvByteBufAllocator
RecvByteBufAllocator.DelegatingHandle, RecvByteBufAllocator.ExtendedHandle, RecvByteBufAllocator.Handle
-
-
Constructor Summary
Constructors Constructor Description FixedRecvByteBufAllocator(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 RecvByteBufAllocator.Handle
newHandle()
Creates a new handle.FixedRecvByteBufAllocator
respectMaybeMoreData(boolean respectMaybeMoreData)
Determine if future instances ofRecvByteBufAllocator.newHandle()
will stop reading if we think there is no more data.-
Methods inherited from class io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator
maxMessagesPerRead, maxMessagesPerRead, respectMaybeMoreData
-
-
-
-
Method Detail
-
newHandle
public RecvByteBufAllocator.Handle newHandle()
Description copied from interface:RecvByteBufAllocator
Creates a new handle. The handle provides the actual operations and keeps the internal information which is required for predicting an optimal buffer capacity.
-
respectMaybeMoreData
public FixedRecvByteBufAllocator respectMaybeMoreData(boolean respectMaybeMoreData)
Description copied from class:DefaultMaxMessagesRecvByteBufAllocator
Determine if future instances ofRecvByteBufAllocator.newHandle()
will stop reading if we think there is no more data.- Overrides:
respectMaybeMoreData
in classDefaultMaxMessagesRecvByteBufAllocator
- Parameters:
respectMaybeMoreData
-true
to stop reading if we think there is no more data. This may save a system call to read from the socket, but if data has arrived in a racy fashion we may give up ourDefaultMaxMessagesRecvByteBufAllocator.maxMessagesPerRead()
quantum and have to wait for the selector to notify us of more data.false
to keep reading (up toDefaultMaxMessagesRecvByteBufAllocator.maxMessagesPerRead()
) or until there is no data when we attempt to read.
- Returns:
this
.
-
-