|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
seda.nbio.NonblockingInputStream
public abstract class NonblockingInputStream
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).
Constructor Summary | |
---|---|
NonblockingInputStream()
|
Method Summary | |
---|---|
abstract int |
available()
|
abstract void |
close()
|
abstract int |
nbRead()
Perform a non-blocking read of one byte from this input stream. |
abstract int |
read()
Perform a blocking read of one byte from this input stream. |
abstract int |
read(byte[] b)
Perform a non-blocking read of up to b.length bytes
from the underlying stream. |
abstract 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 long |
skip(long n)
Skip n bytes of input. |
Methods inherited from class java.io.InputStream |
---|
mark, markSupported, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NonblockingInputStream()
Method Detail |
---|
public abstract int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public abstract int nbRead() throws java.io.IOException
java.io.IOException
public abstract int read(byte[] b) throws java.io.IOException
b.length
bytes
from the underlying stream.
read
in class java.io.InputStream
java.io.IOException
public abstract int read(byte[] b, int off, int len) throws java.io.IOException
len
bytes from the
underlying stream into the byte array b
starting at offset
off
.
read
in class java.io.InputStream
java.io.IOException
public abstract long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public abstract int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public abstract void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStream
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |