|
JBoss Marshalling 1.3.0.CR9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.jboss.marshalling.NioByteInput
public class NioByteInput

A ByteInput implementation which is populated asynchronously with ByteBuffer instances.
| Nested Class Summary | |
|---|---|
static interface |
NioByteInput.BufferReturn
A handler for returning buffers which are have been exhausted. |
static interface |
NioByteInput.InputHandler
A handler for events relating to the consumption of data from a NioByteInput instance. |
| Constructor Summary | |
|---|---|
NioByteInput(NioByteInput.InputHandler inputHandler)
Construct a new instance. |
|
| Method Summary | |
|---|---|
int |
available()
Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. |
void |
close()
|
void |
push(ByteBuffer buffer)
Push a buffer into the queue. |
void |
push(ByteBuffer buffer,
NioByteInput.BufferReturn bufferReturn)
Push a buffer into the queue. |
void |
pushEof()
Push the EOF condition into the queue. |
void |
pushException(IOException e)
Push an exception condition into the queue. |
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] b,
int off,
int len)
Read some bytes from the input stream into the given array. |
long |
skip(long qty)
Skips over and discards up to n bytes of data from this input stream. |
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported, read, reset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jboss.marshalling.ByteInput |
|---|
read |
| Constructor Detail |
|---|
public NioByteInput(NioByteInput.InputHandler inputHandler)
inputHandler will
be invoked after each buffer is fully read and when the stream is closed.
inputHandler - the input events handler| Method Detail |
|---|
public void push(ByteBuffer buffer)
Semaphore.
buffer - the buffer from which more data should be read
public void push(ByteBuffer buffer,
NioByteInput.BufferReturn bufferReturn)
Semaphore.
buffer - the buffer from which more data should be readbufferReturn - the buffer return to send this buffer to when it is exhaustedpublic void pushEof()
public void pushException(IOException e)
e - the exception to push
public int read()
throws IOException
read in interface ByteInputread in class InputStreamIOException - if an error occurs
public int read(byte[] b,
int off,
int len)
throws IOException
read in interface ByteInputread in class InputStreamb - the destination arrayoff - the offset into the array into which data should be readlen - the number of bytes to attempt to fill in the destination array
IOException - if an error occurs
public int available()
throws IOException
available in interface ByteInputavailable in class InputStreamIOException - if an error occurs
public long skip(long qty)
throws IOException
ByteInputn bytes of data from this input stream. If the end of stream is reached,
this method returns 0 in order to be consistent with InputStream.skip(long).
skip in interface ByteInputskip in class InputStreamqty - the number of bytes to attempt to skip
IOException - if an error occurs
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException
|
JBoss Marshalling 1.3.0.CR9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||