Top Description Inners Methods
io.netty.channel

public Interface RecvByteBufAllocator

Known Direct Subinterfaces
io.netty.channel.MaxBytesRecvByteBufAllocator, io.netty.channel.MaxMessagesRecvByteBufAllocator
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, io.netty.util.UncheckedBooleanSupplier, io.netty.util.internal.UnstableApi

Allocates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
RecvByteBufAllocator.DelegatingHandle

Deprecated as a consequence of RecvByteBufAllocator.Handle being deprecated.
A Handle which delegates all call to some other Handle.
public static interface
RecvByteBufAllocator.ExtendedHandle

Deprecated as a consequence of RecvByteBufAllocator.Handle being deprecated.
public static interface

Method Summary

Modifier and TypeMethod and Description
public RecvByteBufAllocator.Handle
newHandle()

Deprecated as a consequence of RecvByteBufAllocator.Handle being deprecated.
Creates a new handle.

Method Detail

newHandleback to summary
public RecvByteBufAllocator.Handle newHandle()

Deprecated

as a consequence of RecvByteBufAllocator.Handle being deprecated. See corresponding docs for further information.

Creates a new handle. The handle provides the actual operations and keeps the internal information which is required for predicting an optimal buffer capacity.

io.netty.channel back to summary

public Class RecvByteBufAllocator.DelegatingHandle

extends Object
implements Handle
Class Inheritance
All Implemented Interfaces
io.netty.channel.RecvByteBufAllocator.Handle

Deprecated

as a consequence of RecvByteBufAllocator.Handle being deprecated. See corresponding docs for further information.

A Handle which delegates all call to some other Handle.

Field Summary

Modifier and TypeField and Description
private final RecvByteBufAllocator.Handle
delegate

Deprecated as a consequence of RecvByteBufAllocator.Handle being deprecated.

Constructor Summary

AccessConstructor and Description
public
DelegatingHandle(RecvByteBufAllocator.Handle delegate)

Deprecated as a consequence of RecvByteBufAllocator.Handle being deprecated.

Method Summary

Modifier and TypeMethod and Description
public ByteBuf
allocate(ByteBufAllocator alloc)

Implements io.netty.channel.RecvByteBufAllocator.Handle.allocate.

Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.
public int
attemptedBytesRead()

Implements io.netty.channel.RecvByteBufAllocator.Handle.attemptedBytesRead.

Get how many bytes the read operation will (or did) attempt to read.
public void
attemptedBytesRead(int
How many bytes the read operation will (or did) attempt to read.
bytes
)

Implements io.netty.channel.RecvByteBufAllocator.Handle.attemptedBytesRead.

Set how many bytes the read operation will (or did) attempt to read.
public boolean
continueReading()

Implements io.netty.channel.RecvByteBufAllocator.Handle.continueReading.

Determine if the current read loop should continue.
protected final RecvByteBufAllocator.Handle

Returns:

the Handle which all methods will be delegated to.
delegate
()

Deprecated as a consequence of RecvByteBufAllocator.Handle being deprecated.
Get the Handle which all methods will be delegated to.
public int
guess()

Implements io.netty.channel.RecvByteBufAllocator.Handle.guess.

Similar to allocate(ByteBufAllocator) except that it does not allocate anything but just tells the capacity.
public void
incMessagesRead(int
The amount to increment by.
numMessages
)

Implements io.netty.channel.RecvByteBufAllocator.Handle.incMessagesRead.

Increment the number of messages that have been read for the current read loop.
public void
lastBytesRead(int
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().
bytes
)

Implements io.netty.channel.RecvByteBufAllocator.Handle.lastBytesRead.

Set the bytes that have been read for the last read operation.
public int
lastBytesRead()

Implements io.netty.channel.RecvByteBufAllocator.Handle.lastBytesRead.

Get the amount of bytes for the previous read operation.
public void
public void
reset(ChannelConfig
The channel configuration which may impact this object's behavior.
config
)

Implements io.netty.channel.RecvByteBufAllocator.Handle.reset.

Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next read loop.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final RecvByteBufAllocator.Handle delegate

Deprecated

as a consequence of RecvByteBufAllocator.Handle being deprecated. See corresponding docs for further information.

Constructor Detail

DelegatingHandleback to summary
public DelegatingHandle(RecvByteBufAllocator.Handle delegate)

Deprecated

as a consequence of RecvByteBufAllocator.Handle being deprecated. See corresponding docs for further information.

Method Detail

allocateback to summary
public ByteBuf allocate(ByteBufAllocator alloc)

Implements io.netty.channel.RecvByteBufAllocator.Handle.allocate.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.allocate.

Creates a new receive buffer whose capacity is probably large enough to read all inbound data and small enough not to waste its space.

Annotations
@Override
attemptedBytesReadback to summary
public int attemptedBytesRead()

Implements io.netty.channel.RecvByteBufAllocator.Handle.attemptedBytesRead.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.attemptedBytesRead.

Get how many bytes the read operation will (or did) attempt to read.

Returns:int

How many bytes the read operation will (or did) attempt to read.

Annotations
@Override
attemptedBytesReadback to summary
public void attemptedBytesRead(int bytes)

Implements io.netty.channel.RecvByteBufAllocator.Handle.attemptedBytesRead.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.attemptedBytesRead.

Set how many bytes the read operation will (or did) attempt to read.

Parameters
bytes:int

How many bytes the read operation will (or did) attempt to read.

Annotations
@Override
continueReadingback to summary
public boolean continueReading()

Implements io.netty.channel.RecvByteBufAllocator.Handle.continueReading.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.continueReading.

Determine if the current read loop should continue.

Returns:boolean

true if the read loop should continue reading. false if the read loop is complete.

Annotations
@Override
delegateback to summary
protected final RecvByteBufAllocator.Handle delegate()

Deprecated

as a consequence of RecvByteBufAllocator.Handle being deprecated. See corresponding docs for further information.

Get the Handle which all methods will be delegated to.

Returns:RecvByteBufAllocator.Handle

the Handle which all methods will be delegated to.

guessback to summary
public int guess()

Implements io.netty.channel.RecvByteBufAllocator.Handle.guess.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.guess.

Similar to allocate(ByteBufAllocator) except that it does not allocate anything but just tells the capacity.

Annotations
@Override
incMessagesReadback to summary
public void incMessagesRead(int numMessages)

Implements io.netty.channel.RecvByteBufAllocator.Handle.incMessagesRead.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.incMessagesRead.

Increment the number of messages that have been read for the current read loop.

Parameters
numMessages:int

The amount to increment by.

Annotations
@Override
lastBytesReadback to summary
public void lastBytesRead(int bytes)

Implements io.netty.channel.RecvByteBufAllocator.Handle.lastBytesRead.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.lastBytesRead.

Set the bytes that have been read for the last read operation. This may be used to increment the number of bytes that have been read.

Parameters
bytes:int

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().

Annotations
@Override
lastBytesReadback to summary
public int lastBytesRead()

Implements io.netty.channel.RecvByteBufAllocator.Handle.lastBytesRead.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.lastBytesRead.

Get the amount of bytes for the previous read operation.

Returns:int

The amount of bytes for the previous read operation.

Annotations
@Override
readCompleteback to summary
public void readComplete()

Implements io.netty.channel.RecvByteBufAllocator.Handle.readComplete.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.readComplete.

The read has completed.

Annotations
@Override
resetback to summary
public void reset(ChannelConfig config)

Implements io.netty.channel.RecvByteBufAllocator.Handle.reset.

Doc from io.netty.channel.RecvByteBufAllocator.Handle.reset.

Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next read loop.

This may be used by continueReading() to determine if the read operation should complete.

This is only ever a hint and may be ignored by the implementation.
Parameters
config:ChannelConfig

The channel configuration which may impact this object's behavior.

Annotations
@Override
io.netty.channel back to summary

public Interface RecvByteBufAllocator.ExtendedHandle

extends Handle
Known Direct Implementers
io.netty.channel.DefaultMaxBytesRecvByteBufAllocator.HandleImpl, io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator.MaxMessageHandle
Annotations
@SuppressWarnings:deprecation
@UnstableApi

Deprecated

as a consequence of RecvByteBufAllocator.Handle being deprecated. See corresponding docs for further information.

Method Summary

Modifier and TypeMethod and Description
public boolean
continueReading(UncheckedBooleanSupplier
A supplier that determines if there maybe more data to read.
maybeMoreDataSupplier
)

Same as Handle#continueReading() except "more data" is determined by the supplier parameter.

Inherited from io.netty.channel.RecvByteBufAllocator.Handle:
allocateattemptedBytesReadattemptedBytesReadcontinueReadingguessincMessagesReadlastBytesReadlastBytesReadreadCompletereset

Method Detail

continueReadingback to summary
public boolean continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier)

Same as Handle#continueReading() except "more data" is determined by the supplier parameter.

Parameters
maybeMoreDataSupplier:UncheckedBooleanSupplier

A supplier that determines if there maybe more data to read.

io.netty.channel back to summary

public Interface RecvByteBufAllocator.Handle

Known Direct Subinterfaces
io.netty.channel.RecvByteBufAllocator.ExtendedHandle
Known Direct Implementers
io.netty.channel.RecvByteBufAllocator.DelegatingHandle
Annotations
@Deprecated

Deprecated

Use ExtendedHandle.

Method Summary

Modifier and TypeMethod and Description
public 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.

public void
attemptedBytesRead(int
How many bytes the read operation will (or did) attempt to read.
bytes
)

Set how many bytes the read operation will (or did) attempt to read.

public int

Returns:

How many bytes the read operation will (or did) attempt to read.
attemptedBytesRead
()

Get how many bytes the read operation will (or did) attempt to read.

public boolean

Returns:

true if the read loop should continue reading. false if the read loop is complete.
continueReading
()

Determine if the current read loop should continue.

public int
guess()

Similar to allocate(ByteBufAllocator) except that it does not allocate anything but just tells the capacity.

public void
incMessagesRead(int
The amount to increment by.
numMessages
)

Increment the number of messages that have been read for the current read loop.

public void
lastBytesRead(int
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().
bytes
)

Set the bytes that have been read for the last read operation.

public int

Returns:

The amount of bytes for the previous read operation.
lastBytesRead
()

Get the amount of bytes for the previous read operation.

public void
readComplete()

The read has completed.

public void
reset(ChannelConfig
The channel configuration which may impact this object's behavior.
config
)

Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next read loop.

Method Detail

allocateback to summary
public 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.

attemptedBytesReadback to summary
public void attemptedBytesRead(int bytes)

Set how many bytes the read operation will (or did) attempt to read.

Parameters
bytes:int

How many bytes the read operation will (or did) attempt to read.

attemptedBytesReadback to summary
public int attemptedBytesRead()

Get how many bytes the read operation will (or did) attempt to read.

Returns:int

How many bytes the read operation will (or did) attempt to read.

continueReadingback to summary
public boolean continueReading()

Determine if the current read loop should continue.

Returns:boolean

true if the read loop should continue reading. false if the read loop is complete.

guessback to summary
public int guess()

Similar to allocate(ByteBufAllocator) except that it does not allocate anything but just tells the capacity.

incMessagesReadback to summary
public void incMessagesRead(int numMessages)

Increment the number of messages that have been read for the current read loop.

Parameters
numMessages:int

The amount to increment by.

lastBytesReadback to summary
public void lastBytesRead(int bytes)

Set the bytes that have been read for the last read operation. This may be used to increment the number of bytes that have been read.

Parameters
bytes:int

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().

lastBytesReadback to summary
public int lastBytesRead()

Get the amount of bytes for the previous read operation.

Returns:int

The amount of bytes for the previous read operation.

readCompleteback to summary
public void readComplete()

The read has completed.

resetback to summary
public void reset(ChannelConfig config)

Reset any counters that have accumulated and recommend how many messages/bytes should be read for the next read loop.

This may be used by continueReading() to determine if the read operation should complete.

This is only ever a hint and may be ignored by the implementation.
Parameters
config:ChannelConfig

The channel configuration which may impact this object's behavior.