Package org.jline.utils
Class NonBlockingPumpInputStream
java.lang.Object
java.io.InputStream
org.jline.utils.NonBlockingInputStream
org.jline.utils.NonBlockingPumpInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
Fields inherited from class org.jline.utils.NonBlockingInputStream
closed, EOF, READ_EXPIRED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintprotected voidvoidclose()Closes this input stream and marks it as closed.voidSignals that the write side has been closed and no more data will be written.intread(byte[] b, int off, int len) intread(long timeout, boolean isPeek) intreadBuffered(byte[] b, int off, int len, long timeout) voidsetIoException(IOException exception) Methods inherited from class org.jline.utils.NonBlockingInputStream
checkClosed, peek, read, read, readBuffered, readBuffered, setPollFunction, shutdownMethods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
NonBlockingPumpInputStream
public NonBlockingPumpInputStream() -
NonBlockingPumpInputStream
public NonBlockingPumpInputStream(int bufferSize)
-
-
Method Details
-
getOutputStream
-
available
public int available()- Overrides:
availablein classInputStream
-
read
- Overrides:
readin classNonBlockingInputStream- Throws:
IOException
-
read
- Specified by:
readin classNonBlockingInputStream- Throws:
IOException
-
readBuffered
- Overrides:
readBufferedin classNonBlockingInputStream- Throws:
IOException
-
setIoException
-
checkIoException
- Throws:
IOException
-
closeWriter
public void closeWriter()Signals that the write side has been closed and no more data will be written. Any buffered data can still be read; reads will returnNonBlockingInputStream.EOFonly after all buffered data has been consumed. This is analogous to closing the write end of a Unix pipe: the read end drains remaining data before seeing EOF. -
close
Description copied from class:NonBlockingInputStreamCloses this input stream and marks it as closed.Subsequent read operations behavior depends on the
PROP_CLOSE_MODEsetting:"strict"- ThrowClosedException(default in JLine 4.x)"warn"- Log a warning but continue (default in JLine 3.x)"lenient"- Silently allow access
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classNonBlockingInputStream- Throws:
IOException- if an I/O error occurs
-