Package org.jline.utils
Class NonBlockingPumpInputStream
- 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classNonBlockingPumpInputStream.NbpOutputStream
-
Field Summary
Fields Modifier and Type Field Description private booleanclosedprivate static intDEFAULT_BUFFER_SIZEprivate java.io.IOExceptionioExceptionprivate java.io.OutputStreamoutputprivate java.nio.ByteBufferreadBufferprivate java.nio.ByteBufferwriteBuffer-
Fields inherited from class org.jline.utils.NonBlockingInputStream
EOF, READ_EXPIRED
-
-
Constructor Summary
Constructors Constructor Description NonBlockingPumpInputStream()NonBlockingPumpInputStream(int bufferSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()protected voidcheckIoException()voidclose()(package private) voidflush()java.io.OutputStreamgetOutputStream()intread(long timeout, boolean isPeek)intreadBuffered(byte[] b)private static booleanrewind(java.nio.ByteBuffer buffer, java.nio.ByteBuffer other)voidsetIoException(java.io.IOException exception)private intwait(java.nio.ByteBuffer buffer, long timeout)(package private) voidwrite(byte[] cbuf, int off, int len)-
Methods inherited from class org.jline.utils.NonBlockingInputStream
peek, read, read, read, shutdown
-
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE
- See Also:
- Constant Field Values
-
readBuffer
private final java.nio.ByteBuffer readBuffer
-
writeBuffer
private final java.nio.ByteBuffer writeBuffer
-
output
private final java.io.OutputStream output
-
closed
private boolean closed
-
ioException
private java.io.IOException ioException
-
-
Method Detail
-
getOutputStream
public java.io.OutputStream getOutputStream()
-
wait
private int wait(java.nio.ByteBuffer buffer, long timeout) throws java.io.IOException- Throws:
java.io.IOException
-
rewind
private static boolean rewind(java.nio.ByteBuffer buffer, java.nio.ByteBuffer other)
-
available
public int available()
- Overrides:
availablein classjava.io.InputStream
-
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) 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
-
write
void write(byte[] cbuf, int off, int len) throws java.io.IOException- Throws:
java.io.IOException
-
flush
void flush()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
-