- java.lang.Object
-
- java.io.InputStream
-
- org.jline.utils.NonBlockingInputStream
-
- org.jline.utils.NonBlockingPumpInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class NonBlockingPumpInputStream extends NonBlockingInputStream
-
-
Field Summary
-
Fields inherited from class org.jline.utils.NonBlockingInputStream
closed, EOF, READ_EXPIRED
-
-
Constructor Summary
Constructors Constructor Description NonBlockingPumpInputStream()NonBlockingPumpInputStream(int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()protected voidcheckIoException()voidclose()Closes this input stream and marks it as closed.voidcloseWriter()Signals that the write side has been closed and no more data will be written.java.io.OutputStreamgetOutputStream()intread(byte[] b, int off, int len)intread(long timeout, boolean isPeek)intreadBuffered(byte[] b, int off, int len, long timeout)voidsetIoException(java.io.IOException exception)-
Methods inherited from class org.jline.utils.NonBlockingInputStream
checkClosed, peek, read, read, readBuffered, readBuffered, setPollFunction, shutdown
-
-
-
-
Method Detail
-
getOutputStream
public java.io.OutputStream getOutputStream()
-
available
public int available()
- Overrides:
availablein classjava.io.InputStream
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classNonBlockingInputStream- Throws:
java.io.IOException
-
read
public int read(long timeout, boolean isPeek) throws java.io.IOException- Specified by:
readin classNonBlockingInputStream- Throws:
java.io.IOException
-
readBuffered
public int readBuffered(byte[] b, int off, int len, long timeout) throws java.io.IOException- Overrides:
readBufferedin classNonBlockingInputStream- Throws:
java.io.IOException
-
setIoException
public void setIoException(java.io.IOException exception)
-
checkIoException
protected void checkIoException() throws java.io.IOException- Throws:
java.io.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
public void close() throws java.io.IOExceptionDescription 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 interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classNonBlockingInputStream- Throws:
java.io.IOException- if an I/O error occurs
-
-