com.caucho.remote.websocket
Class WebSocketWriter

java.lang.Object
  extended by java.io.Writer
      extended by com.caucho.remote.websocket.WebSocketWriter
All Implemented Interfaces:
WebSocketConstants, java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class WebSocketWriter
extends java.io.Writer
implements WebSocketConstants

WebSocketOutputStream writes a single WebSocket packet.

 


Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Fields inherited from interface com.caucho.remote.websocket.WebSocketConstants
CLOSE_ERROR, CLOSE_MESSAGE_TOO_BIG, CLOSE_OK, CLOSE_UTF8, FLAG_FIN, FLAG_MASK, MASK_OPCODE, OP_BINARY, OP_CLOSE, OP_CONT, OP_PING, OP_PONG, OP_TEXT, VERSION
 
Constructor Summary
WebSocketWriter(java.io.OutputStream os, byte[] buffer)
           
 
Method Summary
 void close()
           
 void destroy()
           
 void flush()
           
 void init()
           
 void write(char[] buffer, int offset, int length)
           
 void write(int ch)
           
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketWriter

public WebSocketWriter(java.io.OutputStream os,
                       byte[] buffer)
                throws java.io.IOException
Throws:
java.io.IOException
Method Detail

init

public void init()
          throws java.io.IOException
Throws:
java.io.IOException

write

public void write(int ch)
Overrides:
write in class java.io.Writer

write

public void write(char[] buffer,
                  int offset,
                  int length)
Specified by:
write in class java.io.Writer

flush

public void flush()
Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer

close

public void close()
Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer

destroy

public void destroy()
             throws java.io.IOException
Throws:
java.io.IOException