|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
com.sun.grizzly.filter.RemoteInputStream
public class RemoteInputStream
Stream that blocks on empty read()
until close()
is called. This is usefull in scenarios where a server streams FragmentMessage
to a client.
Enables therefore Client to start processing bytes as soon as first FragmentMessage
arrives.
When finished a Server or Producer of bytes must call close()
so that client
is released from waiting on this stream.
Constructor Summary | |
---|---|
RemoteInputStream()
|
Method Summary | |
---|---|
void |
add(ByteBuffer buffer)
Adds a ByteBuffer to the stream |
void |
add(List<ByteBuffer> bList)
Adds a List of ByteBuffers to the Stream |
int |
available()
|
void |
close()
Adds EOF to end of Stream. |
long |
getTimeStamp()
|
boolean |
isApplicationLayerException()
|
int |
read()
If no bytes are available blocks until close() is called. |
int |
read(byte[] bytes,
int off,
int len)
If no bytes are available blocks until close() is called |
void |
setApplicationLayerException(boolean applicationLayerException)
|
void |
setIOException(IOException exception)
|
long |
skip(long n)
|
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 |
Constructor Detail |
---|
public RemoteInputStream()
Method Detail |
---|
public boolean isApplicationLayerException()
public void setApplicationLayerException(boolean applicationLayerException)
public void setIOException(IOException exception)
public long getTimeStamp()
public void add(ByteBuffer buffer)
buffer
- bytes to add to inputstreampublic void add(List<ByteBuffer> bList)
bList
- List of ByteBuffer containing stream bytespublic void close()
close
in interface Closeable
close
in class InputStream
public int read() throws IOException
close()
is called.
read
in class InputStream
IOException
public int read(byte[] bytes, int off, int len) throws IOException
close()
is called
read
in class InputStream
bytes
- byte array to be filledoff
- offsetlen
- size
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |