Class ReadBuffer

java.lang.Object
org.aesh.terminal.telnet.ReadBuffer
All Implemented Interfaces:
Consumer<int[]>

public class ReadBuffer extends Object implements Consumer<int[]>
Buffer for queuing and dispatching terminal input data to a read handler.
Author:
Julien Viet
  • Constructor Details

    • ReadBuffer

      public ReadBuffer(Executor executor)
      Creates a new ReadBuffer with the specified executor.
      Parameters:
      executor - the executor used for dispatching data to the read handler
  • Method Details

    • accept

      public void accept(int[] data)
      Specified by:
      accept in interface Consumer<int[]>
    • getReadHandler

      public Consumer<int[]> getReadHandler()
      Returns the current read handler.
      Returns:
      the read handler, or null if none is set
    • setReadHandler

      public void setReadHandler(Consumer<int[]> readHandler)
      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