|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.jvoicexml.client.text.NonBlockingObjectInputStream
public final class NonBlockingObjectInputStream
ObjectInputStream is not usable with Java new I/O. It
requires a decoupling from the original stream.
This stream can be used in two ways
InputStream
(see NonBlockingObjectInputStream(InputStream)) andReadableByteChannel
(see NonBlockingObjectInputStream(ReadableByteChannel)).
| Constructor Summary | |
|---|---|
NonBlockingObjectInputStream(InputStream input)
Constructs a new object with the given input stream as a source. |
|
NonBlockingObjectInputStream(ReadableByteChannel channel)
Constructs a new object. |
|
| Method Summary | |
|---|---|
int |
available()
|
int |
read()
|
void |
read(SelectionKey key)
Writes a piece of data that has been retrieved from a non blocking IO. |
Object |
readObject()
Reads the next object from the input stream. |
| Methods inherited from class java.io.InputStream |
|---|
close, mark, markSupported, read, read, reset, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NonBlockingObjectInputStream(InputStream input)
An object constructed using this constructor is intended to use the
conventional way of reading from an iInputStream.
input - the input stream to read from.public NonBlockingObjectInputStream(ReadableByteChannel channel)
SelectionKey.
An object constructed using this constructor is intended to use
non-blocking I/O. The maintainer of the ReadableByteChannel
must feed the read buffer via the method
read(SelectionKey).
channel - the channel to read from.| Method Detail |
|---|
public Object readObject()
throws IOException,
ClassNotFoundException
IOException - Error reading
ClassNotFoundException - Unable to instantiate the object.
public void read(SelectionKey key)
throws IOException
key - selection key for reading.
IOException - Error reading.public int available()
available in class InputStream
public int read()
throws IOException
read in class InputStreamIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||