| java.lang.Object java.io.InputStream seda.nbio.NonblockingInputStream
All known Subclasses: seda.sandStorm.lib.util.MultiByteArrayInputStream, seda.nbio.NonblockingSocketInputStream,
NonblockingInputStream | abstract public class NonblockingInputStream extends InputStream (Code) | | A NonblockingInputStream is an InputStream which implements nonblocking
semantics. The only additional method is nbRead() which performs a
nonblocking read of one byte. The read(byte[]) and read(byte[], int, int)
methods are also nonblocking. The standard read(byte) call is blocking
as there is no way to indicate that nothing was read (a -1 means
an error occurred).
|
Method Summary | |
abstract public int | available() | abstract public void | close() | abstract public int | nbRead() Perform a non-blocking read of one byte from this input stream.
Returns -1 if no data is available, or throws an EOFException if the
end of the stream has been reached. | abstract public int | read() Perform a blocking read of one byte from this input stream.
Returns -1 if the end of the stream has been reached.
Use nbRead() to perform a non-blocking read of one byte. | abstract public int | read(byte b) Perform a non-blocking read of up to b.length bytes
from the underlying stream. | abstract public int | read(byte b, int off, int len) Perform a non-blocking read of up to len bytes from the
underlying stream into the byte array b starting at offset
off . | abstract public long | skip(long n) Skip n bytes of input. |
nbRead | abstract public int nbRead() throws IOException(Code) | | Perform a non-blocking read of one byte from this input stream.
Returns -1 if no data is available, or throws an EOFException if the
end of the stream has been reached. Use read() to perform a blocking
read of one byte.
|
read | abstract public int read() throws IOException(Code) | | Perform a blocking read of one byte from this input stream.
Returns -1 if the end of the stream has been reached.
Use nbRead() to perform a non-blocking read of one byte.
|
read | abstract public int read(byte b) throws IOException(Code) | | Perform a non-blocking read of up to b.length bytes
from the underlying stream.
The total number of bytes read into the buffer, 0 if no data was available, or -1 if the end of the stream hasbeen reached. |
read | abstract public int read(byte b, int off, int len) throws IOException(Code) | | Perform a non-blocking read of up to len bytes from the
underlying stream into the byte array b starting at offset
off .
The total number of bytes read into the buffer, 0 if no data was available, or -1 if the end of the stream hasbeen reached. |
skip | abstract public long skip(long n) throws IOException(Code) | | Skip n bytes of input. This is a blocking operation.
|
|
|