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 booleanprivate intprivate final intprivate final intprivate final intprivate final intprivate int -
Constructor Summary
ConstructorsConstructorDescriptionHandleImpl(int minIndex, int maxIndex, int initialIndex, int minCapacity, int maxCapacity) -
Method Summary
Modifier and TypeMethodDescriptionintguess()Similar toRecvByteBufAllocator.Handle.allocate(ByteBufAllocator)except that it does not allocate anything but just tells the capacity.voidlastBytesRead(int bytes) Set the bytes that have been read for the last read operation.voidThe read has completed.private voidrecord(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.HandleSet 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:
lastBytesReadin interfaceRecvByteBufAllocator.Handle- Overrides:
lastBytesReadin 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.HandleSimilar 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.HandleThe read has completed.- Specified by:
readCompletein interfaceRecvByteBufAllocator.Handle- Overrides:
readCompletein classDefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
-