Closeable, AutoCloseable, ReadableNonBlockingPumpReader, NonBlockingReaderImplpublic abstract class NonBlockingReader extends Reader
| Modifier and Type | Field | Description |
|---|---|---|
static int |
EOF |
|
static int |
READ_EXPIRED |
| Constructor | Description |
|---|---|
NonBlockingReader() |
| Modifier and Type | Method | Description |
|---|---|---|
int |
available() |
|
int |
peek(long timeout) |
Peeks to see if there is a byte waiting in the input stream without
actually consuming the byte.
|
int |
read() |
|
int |
read(char[] b,
int off,
int len) |
This version of read() is very specific to jline's purposes, it
will always always return a single byte at a time, rather than filling
the entire buffer.
|
int |
read(long timeout) |
Attempts to read a character from the input stream for a specific
period of time.
|
protected abstract int |
read(long timeout,
boolean isPeek) |
Attempts to read a character from the input stream for a specific
period of time.
|
abstract int |
readBuffered(char[] b) |
|
void |
shutdown() |
Shuts down the thread that is handling blocking I/O.
|
close, mark, markSupported, nullReader, read, read, ready, reset, skip, transferTopublic static final int EOF
public static final int READ_EXPIRED
public void shutdown()
public int read()
throws IOException
read in class ReaderIOExceptionpublic int peek(long timeout)
throws IOException
timeout - The amount of time to wait, 0 == foreverIOException - if anything wrong happenspublic int read(long timeout)
throws IOException
timeout - The amount of time to wait for the characterIOException - if anything wrong happenspublic int read(char[] b,
int off,
int len)
throws IOException
read in class Readerb - the bufferoff - the offset in the bufferlen - the maximum number of chars to readIOException - if anything wrong happenspublic abstract int readBuffered(char[] b)
throws IOException
IOExceptionpublic int available()
protected abstract int read(long timeout,
boolean isPeek)
throws IOException
timeout - The amount of time to wait for the characterisPeek - trueif the character read must not be consumedIOException - if anything wrong happensCopyright © 2020. All rights reserved.