|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grizzly.comet.CometReader
public class CometReader
Non blocking IO reader. This class can be used from a
CometHandler
to execute non blocking read. This is
usefull when the client is pipelining data. The CometHandler
will be notified as soon as bytes are arriving. CometHandler
who wants to be notified just need to register themself
by calling CometContext.registerAsyncRead()
Constructor Summary | |
---|---|
CometReader()
|
Method Summary | |
---|---|
boolean |
isReady()
Return true if this instance is ready to read. |
int |
read(byte[] buf)
Read bytes without blocking. |
int |
read(byte[] buf,
int off,
int len)
Read bytes without blocking. |
void |
recycle()
Recycle this object. |
void |
setByteBuffer(ByteBuffer byteBuffer)
|
protected void |
setChannel(SocketChannel socketChannel)
Set the underlying SocketChannel. |
void |
setNRead(int nRead)
|
void |
setReady(boolean ready)
false if this instance is no longer ready to read. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CometReader()
Method Detail |
---|
protected void setChannel(SocketChannel socketChannel)
public int read(byte[] buf) throws IOException
IOException
public int read(byte[] buf, int off, int len) throws IOException
IOException
public void recycle()
public void setByteBuffer(ByteBuffer byteBuffer)
public void setNRead(int nRead)
public boolean isReady()
public void setReady(boolean ready)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |