seda.nbio.NonblockingInputStream Class Reference

Inherits InputStream.

Inherited by seda.nbio.NonblockingSocketInputStream.

List of all members.


Detailed Description

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).


Public Member Functions

abstract int read () throws IOException
 Perform a blocking read of one byte from this input stream.
abstract int nbRead () throws IOException
 Perform a non-blocking read of one byte from this input stream.
abstract int read (byte b[]) throws IOException
 Perform a non-blocking read of up to b.length bytes from the underlying stream.
abstract int read (byte b[], int off, int len) throws IOException
 Perform a non-blocking read of up to len bytes from the underlying stream into the byte array b starting at offset off.
abstract long skip (long n) throws IOException
 Skip n bytes of input.
abstract int available () throws IOException
abstract void close () throws IOException


Member Function Documentation

abstract int seda.nbio.NonblockingInputStream.available  )  throws IOException [pure virtual]
 

Implemented in seda.nbio.NonblockingSocketInputStream.

abstract void seda.nbio.NonblockingInputStream.close  )  throws IOException [pure virtual]
 

Implemented in seda.nbio.NonblockingSocketInputStream.

abstract int seda.nbio.NonblockingInputStream.nbRead  )  throws IOException [pure virtual]
 

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.

Implemented in seda.nbio.NonblockingSocketInputStream.

abstract int seda.nbio.NonblockingInputStream.read byte  b[],
int  off,
int  len
throws IOException [pure virtual]
 

Perform a non-blocking read of up to len bytes from the underlying stream into the byte array b starting at offset off.

Returns:
The total number of bytes read into the buffer, 0 if no data was available, or -1 if the end of the stream has been reached.

Implemented in seda.nbio.NonblockingSocketInputStream.

abstract int seda.nbio.NonblockingInputStream.read byte  b[]  )  throws IOException [pure virtual]
 

Perform a non-blocking read of up to b.length bytes from the underlying stream.

Returns:
The total number of bytes read into the buffer, 0 if no data was available, or -1 if the end of the stream has been reached.

Implemented in seda.nbio.NonblockingSocketInputStream.

abstract int seda.nbio.NonblockingInputStream.read  )  throws IOException [pure virtual]
 

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.

Implemented in seda.nbio.NonblockingSocketInputStream.

abstract long seda.nbio.NonblockingInputStream.skip long  n  )  throws IOException [pure virtual]
 

Skip n bytes of input.

This is a blocking operation.

Implemented in seda.nbio.NonblockingSocketInputStream.


The documentation for this class was generated from the following file:
Generated on Tue Jun 20 19:05:39 2006 for libnbio2-java by  doxygen 1.4.6