public abstract class DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle extends java.lang.Object implements RecvByteBufAllocator.ExtendedHandle
continueReading().| 构造器和说明 |
|---|
MaxMessageHandle() |
| 限定符和类型 | 方法和说明 |
|---|---|
ByteBuf |
allocate(ByteBufAllocator alloc)
Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small
enough not to waste its space.
|
int |
attemptedBytesRead()
Get how many bytes the read operation will (or did) attempt to read.
|
void |
attemptedBytesRead(int bytes)
Set how many bytes the read operation will (or did) attempt to read.
|
boolean |
continueReading()
Determine if the current read loop should continue.
|
boolean |
continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier)
Same as
RecvByteBufAllocator.Handle.continueReading() except "more data" is determined by the supplier parameter. |
void |
incMessagesRead(int amt)
Increment the number of messages that have been read for the current read loop.
|
int |
lastBytesRead()
Get the amount of bytes for the previous read operation.
|
void |
lastBytesRead(int bytes)
Set the bytes that have been read for the last read operation.
|
void |
readComplete()
The read has completed.
|
void |
reset(ChannelConfig config)
Only
ChannelConfig.getMaxMessagesPerRead() is used. |
protected int |
totalBytesRead() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitguesspublic void reset(ChannelConfig config)
ChannelConfig.getMaxMessagesPerRead() is used.reset 在接口中 RecvByteBufAllocator.Handleconfig - The channel configuration which may impact this object's behavior.public ByteBuf allocate(ByteBufAllocator alloc)
RecvByteBufAllocator.Handleallocate 在接口中 RecvByteBufAllocator.Handlepublic final void incMessagesRead(int amt)
RecvByteBufAllocator.HandleincMessagesRead 在接口中 RecvByteBufAllocator.Handleamt - The amount to increment by.public void lastBytesRead(int bytes)
RecvByteBufAllocator.HandlelastBytesRead 在接口中 RecvByteBufAllocator.Handlebytes - 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 to
RecvByteBufAllocator.Handle.lastBytesRead(). A negative value will signal a termination condition enforced externally
to this class and is not required to be enforced in RecvByteBufAllocator.Handle.continueReading().public final int lastBytesRead()
RecvByteBufAllocator.HandlelastBytesRead 在接口中 RecvByteBufAllocator.Handlepublic boolean continueReading()
RecvByteBufAllocator.HandlecontinueReading 在接口中 RecvByteBufAllocator.Handletrue if the read loop should continue reading. false if the read loop is complete.public boolean continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier)
RecvByteBufAllocator.ExtendedHandleRecvByteBufAllocator.Handle.continueReading() except "more data" is determined by the supplier parameter.continueReading 在接口中 RecvByteBufAllocator.ExtendedHandlemaybeMoreDataSupplier - A supplier that determines if there maybe more data to read.public void readComplete()
RecvByteBufAllocator.HandlereadComplete 在接口中 RecvByteBufAllocator.Handlepublic int attemptedBytesRead()
RecvByteBufAllocator.HandleattemptedBytesRead 在接口中 RecvByteBufAllocator.Handlepublic void attemptedBytesRead(int bytes)
RecvByteBufAllocator.HandleattemptedBytesRead 在接口中 RecvByteBufAllocator.Handlebytes - How many bytes the read operation will (or did) attempt to read.protected final int totalBytesRead()