@Deprecated
public static interface RecvByteBufAllocator.Handle
限定符和类型 | 方法和说明 |
---|---|
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.
|
int |
guess()
已过时。
Similar to
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.
|
ByteBuf allocate(ByteBufAllocator alloc)
int guess()
allocate(ByteBufAllocator)
except that it does not allocate anything but just tells the
capacity.void reset(ChannelConfig config)
This may be used by continueReading()
to determine if the read operation should complete.
config
- The channel configuration which may impact this object's behavior.void incMessagesRead(int numMessages)
numMessages
- The amount to increment by.void lastBytesRead(int bytes)
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
lastBytesRead()
. A negative value will signal a termination condition enforced externally
to this class and is not required to be enforced in continueReading()
.int lastBytesRead()
void attemptedBytesRead(int bytes)
bytes
- How many bytes the read operation will (or did) attempt to read.int attemptedBytesRead()
boolean continueReading()
true
if the read loop should continue reading. false
if the read loop is complete.void readComplete()