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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private static final int
private IOException
private final OutputStream
private final ByteBuffer
private final ByteBuffer
Fields inherited from class org.jline.utils.NonBlockingInputStream
EOF, READ_EXPIRED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
protected void
void
close()
(package private) void
flush()
int
read
(long timeout, boolean isPeek) int
readBuffered
(byte[] b) private static boolean
rewind
(ByteBuffer buffer, ByteBuffer other) void
setIoException
(IOException exception) private int
wait
(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, shutdown
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE- See Also:
-
readBuffer
-
writeBuffer
-
output
-
closed
private boolean closed -
ioException
-
-
Constructor Details
-
NonBlockingPumpInputStream
public NonBlockingPumpInputStream() -
NonBlockingPumpInputStream
public NonBlockingPumpInputStream(int bufferSize)
-
-
Method Details
-
getOutputStream
-
wait
- Throws:
IOException
-
rewind
-
available
public int available()- Overrides:
available
in classInputStream
-
read
- Specified by:
read
in classNonBlockingInputStream
- Throws:
IOException
-
readBuffered
- Overrides:
readBuffered
in classNonBlockingInputStream
- Throws:
IOException
-
setIoException
-
checkIoException
- Throws:
IOException
-
write
- Throws:
IOException
-
flush
void flush() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-