public abstract class Frame extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
FIN_BIT_ON |
static int |
MASK_BIT_MASKED |
static int |
OPCODE_BINARY |
static int |
OPCODE_CLOSE |
static int |
OPCODE_CONT |
static int |
OPCODE_PING |
static int |
OPCODE_PONG |
static int |
OPCODE_TEXT |
| Modifier | Constructor and Description |
|---|---|
protected |
Frame(int size) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getFrameBytes() |
protected abstract byte |
getOpCode() |
protected abstract byte[] |
getPayload() |
abstract int |
getPayloadSize() |
int |
getSize() |
abstract String |
getTypeAsString() |
boolean |
isBinary() |
boolean |
isClose() |
boolean |
isControl() |
boolean |
isData() |
boolean |
isPing() |
boolean |
isPong() |
boolean |
isText() |
protected static int |
readFromStream(InputStream stream,
byte[] buffer) |
protected static int |
readFromStream(InputStream stream,
byte[] buffer,
int offset,
int expected,
org.apache.log.Logger logger)
Read from stream until expected number of bytes is read, or the stream is closed.
|
protected static int |
readFromStream(InputStream stream,
byte[] buffer,
org.apache.log.Logger log)
Read from stream until expected number of bytes is read, or the stream is closed.
|
public static final int OPCODE_CONT
public static final int OPCODE_TEXT
public static final int OPCODE_BINARY
public static final int OPCODE_CLOSE
public static final int OPCODE_PING
public static final int OPCODE_PONG
public static final int FIN_BIT_ON
public static final int MASK_BIT_MASKED
public byte[] getFrameBytes()
protected static int readFromStream(InputStream stream, byte[] buffer) throws IOException
IOExceptionprotected static int readFromStream(InputStream stream, byte[] buffer, org.apache.log.Logger log) throws IOException
stream - the stream to read frombuffer - the buffer to write tolog - loggerIOException - if the underlying stream throws an IOExceptionprotected static int readFromStream(InputStream stream, byte[] buffer, int offset, int expected, org.apache.log.Logger logger) throws IOException
stream - the stream to read frombuffer - the buffer to write tooffset - the offset in the bufferexpected - the expected number of bytes to readlogger - loggerIOException - if the underlying stream throws an IOExceptionpublic boolean isData()
public boolean isText()
public boolean isBinary()
public boolean isControl()
public boolean isClose()
public boolean isPing()
public boolean isPong()
protected abstract byte[] getPayload()
protected abstract byte getOpCode()
public abstract String getTypeAsString()
public int getSize()
public abstract int getPayloadSize()