com.sun.grizzly.comet
Class CometWriter
java.lang.Object
com.sun.grizzly.comet.CometWriter
public class CometWriter
- extends java.lang.Object
Non blocking Writer. This class can be used from a
CometHandler to execute non blocking write. If the write was
incomplete, the CometHandler must register itself using
CometContext.registerAsyncWrite()
- Author:
- Jeanfrancois Arcand
|
Field Summary |
protected byte[] |
chunkLength
Buffer used for chunk length conversion. |
|
Method Summary |
boolean |
isComplete()
|
boolean |
isReady()
Return true if this instance is ready to read. |
void |
recycle()
|
protected void |
setChannel(java.nio.channels.SocketChannel socketChannel)
|
void |
setReady(boolean ready)
false if this instance is no longer ready to read. |
int |
write(byte[] buf)
|
int |
write(byte[] buf,
int off,
int len)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
chunkLength
protected byte[] chunkLength
- Buffer used for chunk length conversion.
CometWriter
public CometWriter()
setChannel
protected void setChannel(java.nio.channels.SocketChannel socketChannel)
write
public int write(byte[] buf)
throws java.io.IOException
- Throws:
java.io.IOException
write
public int write(byte[] buf,
int off,
int len)
throws java.io.IOException
- Throws:
java.io.IOException
isComplete
public boolean isComplete()
recycle
public void recycle()
isReady
public boolean isReady()
- Return true if this instance is ready to read.
setReady
public void setReady(boolean ready)
- false if this instance is no longer ready to read.
Copyright © 2010 Oracle. All Rights Reserved.