public static class RecvByteBufAllocator.DelegatingHandle extends java.lang.Object implements RecvByteBufAllocator.Handle
RecvByteBufAllocator.Handle
which delegates all call to some other RecvByteBufAllocator.Handle
.构造器和说明 |
---|
DelegatingHandle(RecvByteBufAllocator.Handle delegate) |
限定符和类型 | 方法和说明 |
---|---|
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.
|
protected RecvByteBufAllocator.Handle |
delegate()
Get the
RecvByteBufAllocator.Handle which all methods will be delegated to. |
int |
guess()
Similar to
RecvByteBufAllocator.Handle.allocate(ByteBufAllocator) except that it does not allocate anything but just tells the
capacity. |
void |
incMessagesRead(int numMessages)
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)
Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next
read loop.
|
public DelegatingHandle(RecvByteBufAllocator.Handle delegate)
protected final RecvByteBufAllocator.Handle delegate()
RecvByteBufAllocator.Handle
which all methods will be delegated to.RecvByteBufAllocator.Handle
which all methods will be delegated to.public ByteBuf allocate(ByteBufAllocator alloc)
RecvByteBufAllocator.Handle
allocate
在接口中 RecvByteBufAllocator.Handle
public int guess()
RecvByteBufAllocator.Handle
RecvByteBufAllocator.Handle.allocate(ByteBufAllocator)
except that it does not allocate anything but just tells the
capacity.guess
在接口中 RecvByteBufAllocator.Handle
public void reset(ChannelConfig config)
RecvByteBufAllocator.Handle
This may be used by RecvByteBufAllocator.Handle.continueReading()
to determine if the read operation should complete.
reset
在接口中 RecvByteBufAllocator.Handle
config
- The channel configuration which may impact this object's behavior.public void incMessagesRead(int numMessages)
RecvByteBufAllocator.Handle
incMessagesRead
在接口中 RecvByteBufAllocator.Handle
numMessages
- The amount to increment by.public void lastBytesRead(int bytes)
RecvByteBufAllocator.Handle
lastBytesRead
在接口中 RecvByteBufAllocator.Handle
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 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 int lastBytesRead()
RecvByteBufAllocator.Handle
lastBytesRead
在接口中 RecvByteBufAllocator.Handle
public boolean continueReading()
RecvByteBufAllocator.Handle
continueReading
在接口中 RecvByteBufAllocator.Handle
true
if the read loop should continue reading. false
if the read loop is complete.public int attemptedBytesRead()
RecvByteBufAllocator.Handle
attemptedBytesRead
在接口中 RecvByteBufAllocator.Handle
public void attemptedBytesRead(int bytes)
RecvByteBufAllocator.Handle
attemptedBytesRead
在接口中 RecvByteBufAllocator.Handle
bytes
- How many bytes the read operation will (or did) attempt to read.public void readComplete()
RecvByteBufAllocator.Handle
readComplete
在接口中 RecvByteBufAllocator.Handle