- java.lang.Object
-
- java.io.Reader
-
- org.jline.utils.NonBlockingReader
-
- org.jline.utils.NonBlockingPumpReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
public class NonBlockingPumpReader extends NonBlockingReader
-
-
Field Summary
-
Fields inherited from class org.jline.utils.NonBlockingReader
EOF, READ_EXPIRED
-
-
Constructor Summary
Constructors Constructor Description NonBlockingPumpReader()NonBlockingPumpReader(int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()WritergetWriter()protected intread(long timeout, boolean isPeek)Attempts to read a character from the input stream for a specific period of time.intreadBuffered(char[] b)booleanready()-
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, reset, skip, transferTo
-
-
-
-
Method Detail
-
getWriter
public Writer getWriter()
-
available
public int available()
- Overrides:
availablein classNonBlockingReader
-
read
protected int read(long timeout, boolean isPeek) throws IOExceptionDescription 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
public int readBuffered(char[] b) throws IOException- Specified by:
readBufferedin classNonBlockingReader- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
-