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 class
NonBlockingPumpInputStream.NbpOutputStream
-
Field Summary
Fields Modifier and Type Field Description private boolean
closed
private static int
DEFAULT_BUFFER_SIZE
private java.io.IOException
ioException
private java.io.OutputStream
output
private java.nio.ByteBuffer
readBuffer
private java.nio.ByteBuffer
writeBuffer
-
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 int
available()
protected void
checkIoException()
void
close()
(package private) void
flush()
java.io.OutputStream
getOutputStream()
int
read(long timeout, boolean isPeek)
int
readBuffered(byte[] b, int off, int len, long timeout)
private static boolean
rewind(java.nio.ByteBuffer buffer, java.nio.ByteBuffer other)
void
setIoException(java.io.IOException exception)
private int
wait(java.nio.ByteBuffer buffer, long timeout)
(package private) void
write(byte[] cbuf, int off, int len)
-
Methods inherited from class org.jline.utils.NonBlockingInputStream
peek, read, read, read, readBuffered, readBuffered, 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:
available
in classjava.io.InputStream
-
read
public int read(long timeout, boolean isPeek) throws java.io.IOException
- Specified by:
read
in classNonBlockingInputStream
- Throws:
java.io.IOException
-
readBuffered
public int readBuffered(byte[] b, int off, int len, long timeout) throws java.io.IOException
- Overrides:
readBuffered
in 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-