Package org.jline.utils
Class NonBlockingPumpReader
- java.lang.Object
-
- java.io.Reader
-
- org.jline.utils.NonBlockingReader
-
- org.jline.utils.NonBlockingPumpReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.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()Closes this reader and marks it as closed.java.io.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, int off, int len, long timeout)booleanready()-
Methods inherited from class org.jline.utils.NonBlockingReader
checkClosed, peek, read, read, read, readBuffered, readBuffered, shutdown
-
-
-
-
Method Detail
-
getWriter
public java.io.Writer getWriter()
-
ready
public boolean ready()
- Overrides:
readyin classjava.io.Reader
-
available
public int available()
- Overrides:
availablein classNonBlockingReader
-
read
protected int read(long timeout, boolean isPeek) throws java.io.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:
java.io.IOException- if anything wrong happens
-
readBuffered
public int readBuffered(char[] b, int off, int len, long timeout) throws java.io.IOException- Specified by:
readBufferedin classNonBlockingReader- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionDescription copied from class:NonBlockingReaderCloses this reader and marks it as closed.Subsequent read operations behavior depends on the
PROP_CLOSE_MODEsetting:"strict"- ThrowClosedException"warn"- Log a warning but continue (default in JLine 3.x)"lenient"- Silently allow access
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classNonBlockingReader- Throws:
java.io.IOException- if an I/O error occurs
-
-