com.caucho.remote.websocket
Class WebSocketOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.caucho.remote.websocket.WebSocketOutputStream
All Implemented Interfaces:
WebSocketConstants, java.io.Closeable, java.io.Flushable

public class WebSocketOutputStream
extends java.io.OutputStream
implements WebSocketConstants

WebSocketOutputStream writes a single WebSocket packet.

 0x82 0xNN binarydata
 


Field Summary
 
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
WebSocketOutputStream(java.io.OutputStream os)
           
WebSocketOutputStream(java.io.OutputStream os, byte[] workingBuffer)
           
 
Method Summary
 void close()
           
 void destroy()
           
 void flush()
           
 void init()
           
 void write(byte[] buffer, int offset, int length)
           
 void write(int ch)
           
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketOutputStream

public WebSocketOutputStream(java.io.OutputStream os,
                             byte[] workingBuffer)
                      throws java.io.IOException
Throws:
java.io.IOException

WebSocketOutputStream

public WebSocketOutputStream(java.io.OutputStream os)
                      throws java.io.IOException
Throws:
java.io.IOException
Method Detail

init

public void init()

write

public void write(int ch)
           throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] buffer,
                  int offset,
                  int length)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException

destroy

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