Top Description Inners Methods
io.netty5.channel

public Interface ReadHandleFactory

Known Direct Implementers
io.netty5.channel.MaxMessagesReadHandleFactory

Implementations allow to influence how much data / messages are read per read loop invocation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ReadHandleFactory.ReadHandle

Handle which allows to customize how data / messages are read.

Method Summary

Modifier and TypeMethod and Description
public ReadHandleFactory.ReadHandle
newHandle(Channel
the Channel for which the ReadHandle is used.
channel
)

Creates a new handle for the given Channel.

Method Detail

newHandleback to summary
public ReadHandleFactory.ReadHandle newHandle(Channel channel)

Creates a new handle for the given Channel.

Parameters
channel:Channel

the Channel for which the ReadHandle is used.

io.netty5.channel back to summary

public Interface ReadHandleFactory.ReadHandle

Known Direct Implementers
io.netty5.channel.MaxMessagesReadHandleFactory.MaxMessageReadHandle

Handle which allows to customize how data / messages are read.

Method Summary

Modifier and TypeMethod and Description
public int
estimatedBufferCapacity()

Guess the capacity for the next receive buffer that is probably large enough to read all inbound data and small enough not to waste its space.

public boolean

Returns:

true if the read loop should continue reading, false otherwise.
lastRead
(int
The number of bytes the read operation did attempt to read.
attemptedBytesRead
,
int
The number of bytes from the previous read operation. This may be negative if a read error occurs.
actualBytesRead
,
int
The number of messages read.
numMessagesRead
)

Notify the ReadHandle of the last read operation and its result.

public void
readComplete()

Method that must be called once the read loop was completed.

Method Detail

estimatedBufferCapacityback to summary
public int estimatedBufferCapacity()

Guess the capacity for the next receive buffer that is probably large enough to read all inbound data and small enough not to waste its space.

lastReadback to summary
public boolean lastRead(int attemptedBytesRead, int actualBytesRead, int numMessagesRead)

Notify the ReadHandle of the last read operation and its result.

Parameters
attemptedBytesRead:int

The number of bytes the read operation did attempt to read.

actualBytesRead:int

The number of bytes from the previous read operation. This may be negative if a read error occurs.

numMessagesRead:int

The number of messages read.

Returns:boolean

true if the read loop should continue reading, false otherwise.

readCompleteback to summary
public void readComplete()

Method that must be called once the read loop was completed.