public abstract class NonBlockingReader extends Reader
Modifier and Type | Field and Description |
---|---|
static int |
EOF |
static int |
READ_EXPIRED |
Constructor and Description |
---|
NonBlockingReader() |
Modifier and Type | Method and 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.
|
void |
shutdown()
Shuts down the thread that is handling blocking I/O.
|
public static final int EOF
public static final int READ_EXPIRED
public void shutdown()
public int read() throws IOException
read
in class Reader
IOException
public int peek(long timeout) throws IOException
timeout
- The amount of time to wait, 0 == foreverIOException
public int read(long timeout) throws IOException
timeout
- The amount of time to wait for the characterIOException
public int read(char[] b, int off, int len) throws IOException
read
in class Reader
IOException
public int available()
protected abstract int read(long timeout, boolean isPeek) throws IOException
timeout
- The amount of time to wait for the characterIOException
Copyright © 2018 JBoss by Red Hat. All rights reserved.