-
- All Known Implementing Classes:
MaxMessagesReadHandleFactory.MaxMessageReadHandle
- Enclosing interface:
- ReadHandleFactory
public static interface ReadHandleFactory.ReadHandleHandle which allows to customize how data / messages are read.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intestimatedBufferCapacity()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.booleanlastRead(int attemptedBytesRead, int actualBytesRead, int numMessagesRead)Notify theReadHandleFactory.ReadHandleof the last read operation and its result.voidreadComplete()Method that must be called once the read loop was completed.
-
-
-
Method Detail
-
estimatedBufferCapacity
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.
-
lastRead
boolean lastRead(int attemptedBytesRead, int actualBytesRead, int numMessagesRead)Notify theReadHandleFactory.ReadHandleof the last read operation and its result.- Parameters:
attemptedBytesRead- The number of bytes the read operation did attempt to read.actualBytesRead- The number of bytes from the previous read operation. This may be negative if a read error occurs.numMessagesRead- The number of messages read.- Returns:
trueif the read loop should continue reading,falseotherwise.
-
readComplete
void readComplete()
Method that must be called once the read loop was completed.
-
-