Package org.jline.utils
Class NonBlockingPumpReader
java.lang.Object
java.io.Reader
org.jline.utils.NonBlockingReader
org.jline.utils.NonBlockingPumpReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
-
Field Summary
Fields inherited from class org.jline.utils.NonBlockingReader
EOF, READ_EXPIRED -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.jline.utils.NonBlockingReader
peek, read, read, read, readBuffered, readBuffered, shutdownMethods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, reset, skip, transferTo
-
Constructor Details
-
NonBlockingPumpReader
public NonBlockingPumpReader() -
NonBlockingPumpReader
public NonBlockingPumpReader(int bufferSize)
-
-
Method Details
-
getWriter
-
ready
-
available
public int available()- Overrides:
availablein classNonBlockingReader
-
read
Description copied from class:NonBlockingReaderAttempts to read a character from the input stream for a specific period of time.- Specified by:
readin classNonBlockingReader- Parameters:
timeout- The amount of time to wait for the characterisPeek-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
- Specified by:
readBufferedin classNonBlockingReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-