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 booleanprivate static final intprivate IOExceptionprivate final OutputStreamprivate final ByteBufferprivate final ByteBufferFields inherited from class org.jline.utils.NonBlockingInputStream
EOF, READ_EXPIRED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintprotected voidvoidclose()(package private) voidflush()intread(long timeout, boolean isPeek) intreadBuffered(byte[] b, int off, int len, long timeout) private static booleanrewind(ByteBuffer buffer, ByteBuffer other) voidsetIoException(IOException exception) private intwait(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, readBuffered, readBuffered, shutdownMethods 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:
availablein classInputStream
-
read
- Specified by:
readin classNonBlockingInputStream- Throws:
IOException
-
readBuffered
- Overrides:
readBufferedin classNonBlockingInputStream- Throws:
IOException
-
setIoException
-
checkIoException
- Throws:
IOException
-
write
- Throws:
IOException
-
flush
void flush() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-