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
FieldsModifier and TypeFieldDescriptionprivate boolean
private int
private final int
private final int
private final int
private final int
private int
-
Constructor Summary
ConstructorsConstructorDescriptionHandleImpl
(int minIndex, int maxIndex, int initialIndex, int minCapacity, int maxCapacity) -
Method Summary
Modifier and TypeMethodDescriptionint
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
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
-
Field Details
-
minIndex
private final int minIndex -
maxIndex
private final int maxIndex -
minCapacity
private final int minCapacity -
maxCapacity
private final int maxCapacity -
index
private int index -
nextReceiveBufferSize
private int nextReceiveBufferSize -
decreaseNow
private boolean decreaseNow
-
-
Constructor Details
-
HandleImpl
HandleImpl(int minIndex, int maxIndex, int initialIndex, int minCapacity, int maxCapacity)
-
-
Method Details
-
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
-