com.sun.grizzly.comet
Class CometWriter

java.lang.Object
  extended by com.sun.grizzly.comet.CometWriter
Direct Known Subclasses:
CometWriter

public class CometWriter
extends 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.
 
Constructor Summary
CometWriter()
           
 
Method Summary
 boolean isComplete()
           
 boolean isReady()
          Return true if this instance is ready to read.
 void recycle()
           
protected  void setChannel(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
 

Field Detail

chunkLength

protected byte[] chunkLength
Buffer used for chunk length conversion.

Constructor Detail

CometWriter

public CometWriter()
Method Detail

setChannel

protected void setChannel(SocketChannel socketChannel)

write

public int write(byte[] buf)
          throws IOException
Throws:
IOException

write

public int write(byte[] buf,
                 int off,
                 int len)
          throws IOException
Throws:
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 © 2008 SUN Microsystems. All Rights Reserved.