Class ReadBuffer
java.lang.Object
org.aesh.terminal.telnet.ReadBuffer
- All Implemented Interfaces:
Consumer<int[]>
Buffer for queuing and dispatching terminal input data to a read handler.
- Author:
- Julien Viet
-
Constructor Summary
ConstructorsConstructorDescriptionReadBuffer(Executor executor) Creates a new ReadBuffer with the specified executor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(int[] data) Consumer<int[]> Returns the current read handler.voidsetReadHandler(Consumer<int[]> readHandler) Sets the read handler for receiving buffered data.
-
Constructor Details
-
ReadBuffer
Creates a new ReadBuffer with the specified executor.- Parameters:
executor- the executor used for dispatching data to the read handler
-
-
Method Details
-
accept
-
getReadHandler
Returns the current read handler.- Returns:
- the read handler, or null if none is set
-
setReadHandler
Sets the read handler for receiving buffered data. When a handler is set, any queued data will be drained to the handler.- Parameters:
readHandler- the handler to receive data, or null to clear the handler
-