public abstract class DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle extends java.lang.Object implements RecvByteBufAllocator.ExtendedHandle
continueReading()每个读取条件的最大消息数。
| Constructor and Description |
|---|
MaxMessageHandle() |
| Modifier and Type | Method and Description |
|---|---|
ByteBuf |
allocate(ByteBufAllocator alloc)
创建一个新的接收缓冲区,其容量可能足够大,可以读取所有入站数据,并且足够小,不会浪费其空间。
|
int |
attemptedBytesRead()
获取读取操作将要(或确实)尝试读取的字节数。
|
void |
attemptedBytesRead(int bytes)
设置读取操作将要(或确实)尝试读取的字节数。
|
boolean |
continueReading()
确定当前的读取循环是否应该继续。
|
boolean |
continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier)
除“更多数据”由供应商参数确定外,与
RecvByteBufAllocator.Handle.continueReading()相同。
|
void |
incMessagesRead(int amt)
增加为当前读取循环读取的消息数量。
|
int |
lastBytesRead()
获取上一次读取操作的字节数量。
|
void |
lastBytesRead(int bytes)
设置上次读取操作所读取的字节。
|
void |
readComplete()
阅读已完成。
|
void |
reset(ChannelConfig config)
|
protected int |
totalBytesRead() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitguesspublic void reset(ChannelConfig config)
reset在界面
RecvByteBufAllocator.Handle
config - 可能影响此对象行为的通道配置。
public ByteBuf allocate(ByteBufAllocator alloc)
RecvByteBufAllocator.Handle复制的描述
allocate在界面
RecvByteBufAllocator.Handle
public final void incMessagesRead(int amt)
RecvByteBufAllocator.Handle复制的描述
incMessagesRead在界面
RecvByteBufAllocator.Handle
amt - 增加的金额。
public void lastBytesRead(int bytes)
RecvByteBufAllocator.Handle
lastBytesRead在界面
RecvByteBufAllocator.Handle
bytes - 来自上一次读取操作的字节数。
如果发生读取错误,这可能是负面的。
如果看到负值,则预计将在下次呼叫RecvByteBufAllocator.Handle.lastBytesRead()时返回 。
负值表示在该类别的外部执行的终止条件,不需要在RecvByteBufAllocator.Handle.continueReading()中强制执行。
public final int lastBytesRead()
RecvByteBufAllocator.Handle
lastBytesRead在界面
RecvByteBufAllocator.Handle
public boolean continueReading()
RecvByteBufAllocator.Handle复制的描述
continueReading在界面
RecvByteBufAllocator.Handle
true如果读取循环应该继续读取。
false如果读取循环完成。
public boolean continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier)
RecvByteBufAllocator.Handle.continueReading() ”相同,但“更多数据”由供应商参数确定。
continueReading在界面
RecvByteBufAllocator.ExtendedHandle
maybeMoreDataSupplier - 确定是否有更多数据可供读取的供应商。
public void readComplete()
RecvByteBufAllocator.Handle复制的描述
readComplete在界面
RecvByteBufAllocator.Handle
public int attemptedBytesRead()
RecvByteBufAllocator.Handle
attemptedBytesRead在界面
RecvByteBufAllocator.Handle
public void attemptedBytesRead(int bytes)
RecvByteBufAllocator.Handle复制的描述
attemptedBytesRead在界面
RecvByteBufAllocator.Handle
bytes - 读取操作将会(或确实)尝试读取多少个字节。
protected final int totalBytesRead()
Copyright © 2008–2018 The Netty Project. All rights reserved.