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 booleandecreaseNowprivate intindexprivate intmaxIndexprivate intminIndexprivate intnextReceiveBufferSize
-
Constructor Summary
Constructors Constructor Description HandleImpl(int minIndex, int maxIndex, int initial)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intguess()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.voidreadComplete()The 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
-
-
-
-
Method Detail
-
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
-
-