public abstract class NonBlockingInputStream extends InputStream
| Modifier and Type | Field and Description |
|---|---|
static int |
EOF |
static int |
READ_EXPIRED |
| Constructor and Description |
|---|
NonBlockingInputStream() |
| Modifier and Type | Method and Description |
|---|---|
int |
peek(long timeout)
Peeks to see if there is a byte waiting in the input stream without
actually consuming the byte.
|
int |
read()
Reads the next byte of data from the input stream.
|
int |
read(byte[] b,
int off,
int len) |
int |
read(long timeout)
Attempts to read a character from the input stream for a specific
period of time.
|
abstract int |
read(long timeout,
boolean isPeek) |
void |
shutdown()
Shuts down the thread that is handling blocking I/O if any.
|
available, close, mark, markSupported, read, reset, skippublic static final int EOF
public static final int READ_EXPIRED
public int read()
throws IOException
int in the range 0 to
255. If no byte is available because the end of the stream
has been reached, the value -1 is returned. This method
blocks until input data is available, the end of the stream is detected,
or an exception is thrown.read in class InputStream-1 if the end of the
stream is reached.IOException - if an I/O error occurs.public int peek(long timeout)
throws IOException
timeout - The amount of time to wait, 0 == foreverIOException - if an I/O error occurs.public int read(long timeout)
throws IOException
timeout - The amount of time to wait for the characterIOException - if an I/O error occurs.public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic void shutdown()
public abstract int read(long timeout,
boolean isPeek)
throws IOException
IOExceptionCopyright © 2018. All rights reserved.