com.caucho.remote.websocket
Class UnmaskedFrameInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.caucho.remote.websocket.FrameInputStream
          extended by com.caucho.remote.websocket.UnmaskedFrameInputStream
All Implemented Interfaces:
WebSocketConstants, java.io.Closeable

public class UnmaskedFrameInputStream
extends FrameInputStream

WebSocketInputStream reads a single WebSocket packet.

 +-+------+---------+-+---------+
 |F|xxx(3)|opcode(4)|R|len(7)   |
 +-+------+---------+-+---------+
 
 OPCODES
   0 - cont
   1 - text
   2 - binary
   8 - close
 


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
UnmaskedFrameInputStream()
           
 
Method Summary
 long getLength()
           
 int getOpcode()
           
 void init(WebSocketContext cxt, java.io.InputStream is)
           
 boolean isFinal()
           
 int read()
           
 int read(byte[] buffer, int offset, int length)
           
protected  boolean readFrameHeaderImpl()
           
 
Methods inherited from class com.caucho.remote.websocket.FrameInputStream
closeError, getContext, handleFrame, initReader, readFrameHeader, skipToFrameEnd
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnmaskedFrameInputStream

public UnmaskedFrameInputStream()
Method Detail

init

public void init(WebSocketContext cxt,
                 java.io.InputStream is)
Overrides:
init in class FrameInputStream

getOpcode

public int getOpcode()
Specified by:
getOpcode in class FrameInputStream

isFinal

public boolean isFinal()
Specified by:
isFinal in class FrameInputStream

getLength

public long getLength()
Specified by:
getLength in class FrameInputStream

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

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

readFrameHeaderImpl

protected boolean readFrameHeaderImpl()
                               throws java.io.IOException
Specified by:
readFrameHeaderImpl in class FrameInputStream
Throws:
java.io.IOException