Package io.netty.channel
Class AdaptiveRecvByteBufAllocator.HandleImpl
- java.lang.Object
-
- io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
-
- io.netty.channel.AdaptiveRecvByteBufAllocator.HandleImpl
-
- All Implemented Interfaces:
RecvByteBufAllocator.ExtendedHandle
,RecvByteBufAllocator.Handle
- Enclosing class:
- AdaptiveRecvByteBufAllocator
private final class AdaptiveRecvByteBufAllocator.HandleImpl extends DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
decreaseNow
private int
index
private int
maxCapacity
private int
maxIndex
private int
minCapacity
private int
minIndex
private int
nextReceiveBufferSize
-
Constructor Summary
Constructors Constructor Description HandleImpl(int minIndex, int maxIndex, int initialIndex, int minCapacity, int maxCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
guess()
Similar toRecvByteBufAllocator.Handle.allocate(ByteBufAllocator)
except that it does not allocate anything but just tells the capacity.void
lastBytesRead(int bytes)
Set the bytes that have been read for the last read operation.void
readComplete()
The read has completed.private void
record(int actualReadBytes)
-
Methods inherited from class io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
allocate, attemptedBytesRead, attemptedBytesRead, continueReading, continueReading, incMessagesRead, lastBytesRead, reset, totalBytesRead
-
-
-
-
Method Detail
-
lastBytesRead
public void lastBytesRead(int bytes)
Description copied from interface:RecvByteBufAllocator.Handle
Set the bytes that have been read for the last read operation. This may be used to increment the number of bytes that have been read.- Specified by:
lastBytesRead
in interfaceRecvByteBufAllocator.Handle
- Overrides:
lastBytesRead
in classDefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
- Parameters:
bytes
- The number of bytes from the previous read operation. This may be negative if an read error occurs. If a negative value is seen it is expected to be return on the next call toRecvByteBufAllocator.Handle.lastBytesRead()
. A negative value will signal a termination condition enforced externally to this class and is not required to be enforced inRecvByteBufAllocator.Handle.continueReading()
.
-
guess
public int guess()
Description copied from interface:RecvByteBufAllocator.Handle
Similar toRecvByteBufAllocator.Handle.allocate(ByteBufAllocator)
except that it does not allocate anything but just tells the capacity.
-
record
private void record(int actualReadBytes)
-
readComplete
public void readComplete()
Description copied from interface:RecvByteBufAllocator.Handle
The read has completed.- Specified by:
readComplete
in interfaceRecvByteBufAllocator.Handle
- Overrides:
readComplete
in classDefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
-
-