public static class RecvByteBufAllocator.DelegatingHandle extends java.lang.Object implements RecvByteBufAllocator.Handle
| Constructor and Description |
|---|
DelegatingHandle(RecvByteBufAllocator.Handle delegate) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuf |
allocate(ByteBufAllocator alloc)
创建一个新的接收缓冲区,其容量可能足够大,可以读取所有入站数据,并且足够小,不会浪费其空间。
|
int |
attemptedBytesRead()
获取读取操作将要(或确实)尝试读取的字节数。
|
void |
attemptedBytesRead(int bytes)
设置读取操作将要(或确实)尝试读取的字节数。
|
boolean |
continueReading()
确定当前的读取循环是否应该继续。
|
protected RecvByteBufAllocator.Handle |
delegate()
获取将所有方法委托给的 RecvByteBufAllocator.Handle 。
|
int |
guess()
类似于
RecvByteBufAllocator.Handle.allocate(ByteBufAllocator),除了它不分配任何东西,只是告诉容量。
|
void |
incMessagesRead(int numMessages)
增加为当前读取循环读取的消息数量。
|
int |
lastBytesRead()
获取上一次读取操作的字节数量。
|
void |
lastBytesRead(int bytes)
设置上次读取操作所读取的字节。
|
void |
readComplete()
阅读已完成。
|
void |
reset(ChannelConfig config)
重置累计的任何计数器,并推荐下一个读取循环应读取多少个消息/字节。
|
public DelegatingHandle(RecvByteBufAllocator.Handle delegate)
protected final RecvByteBufAllocator.Handle delegate()
RecvByteBufAllocator.Handle 。
RecvByteBufAllocator.Handle所有的方法将被委托给。
public ByteBuf allocate(ByteBufAllocator alloc)
RecvByteBufAllocator.Handle复制的描述
allocate接口
RecvByteBufAllocator.Handle
public int guess()
RecvByteBufAllocator.Handle
RecvByteBufAllocator.Handle.allocate(ByteBufAllocator),除了它不分配任何东西,只是告诉容量。
guess接口
RecvByteBufAllocator.Handle
public void reset(ChannelConfig config)
RecvByteBufAllocator.Handle
这可能被RecvByteBufAllocator.Handle.continueReading()用来确定读操作是否应该完成。
reset在界面
RecvByteBufAllocator.Handle
config - 可能影响此对象行为的通道配置。
public void incMessagesRead(int numMessages)
RecvByteBufAllocator.Handle
incMessagesRead在界面
RecvByteBufAllocator.Handle
numMessages - 要增加的金额。
public void lastBytesRead(int bytes)
RecvByteBufAllocator.Handle复制的描述
lastBytesRead在界面
RecvByteBufAllocator.Handle
bytes - 上次读取操作的字节数。
如果发生读取错误,这可能是负面的。
如果看到负值,则预计在下次呼叫RecvByteBufAllocator.Handle.lastBytesRead()时返回 。
负值表示在该课程外部强制执行的终止条件,不需要在RecvByteBufAllocator.Handle.continueReading()中强制执行。
public int lastBytesRead()
RecvByteBufAllocator.Handle复制的描述
lastBytesRead接口
RecvByteBufAllocator.Handle
public boolean continueReading()
RecvByteBufAllocator.Handle复制的描述
continueReading在界面
RecvByteBufAllocator.Handle
true如果读取循环应该继续读取。
false如果读取循环完成。
public int attemptedBytesRead()
RecvByteBufAllocator.Handle
attemptedBytesRead接口
RecvByteBufAllocator.Handle
public void attemptedBytesRead(int bytes)
RecvByteBufAllocator.Handle复制的描述
attemptedBytesRead在界面
RecvByteBufAllocator.Handle
bytes - 读取操作将会(或确实)尝试读取多少个字节。
public void readComplete()
RecvByteBufAllocator.Handle
readComplete在界面
RecvByteBufAllocator.Handle
Copyright © 2008–2018 The Netty Project. All rights reserved.