Class NonBlockingPumpReader

All Implemented Interfaces:
Closeable, AutoCloseable, Readable

public class NonBlockingPumpReader extends NonBlockingReader
  • Constructor Details

    • NonBlockingPumpReader

      public NonBlockingPumpReader()
    • NonBlockingPumpReader

      public NonBlockingPumpReader(int bufferSize)
  • Method Details

    • getWriter

      public Writer getWriter()
    • ready

      public boolean ready()
      Overrides:
      ready in class Reader
    • available

      public int available()
      Overrides:
      available in class NonBlockingReader
    • read

      protected int read(long timeout, boolean isPeek) throws IOException
      Description copied from class: NonBlockingReader
      Attempts to read a character from the input stream for a specific period of time.
      Specified by:
      read in class NonBlockingReader
      Parameters:
      timeout - The amount of time to wait for the character
      isPeek - trueif the character read must not be consumed
      Returns:
      The character read, -1 if EOF is reached, or -2 if the read timed out.
      Throws:
      IOException - if anything wrong happens
    • readBuffered

      public int readBuffered(char[] b, int off, int len, long timeout) throws IOException
      Specified by:
      readBuffered in class NonBlockingReader
      Throws:
      IOException
    • close

      public void close() throws IOException
      Description copied from class: NonBlockingReader
      Closes this reader and marks it as closed.

      Subsequent read operations behavior depends on the PROP_CLOSE_MODE setting:

      • "strict" - Throw ClosedException
      • "warn" - Log a warning but continue (default in JLine 3.x)
      • "lenient" - Silently allow access
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class NonBlockingReader
      Throws:
      IOException - if an I/O error occurs