public interface WebSocketMessage
Modifier and Type | Interface and Description |
---|---|
static class |
WebSocketMessage.Opcode
WebSocketMessage must contain one of the below opcode. |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
getHeader()
The header is used to construct a Web Socket frame when the payload of the
message is being transmitted to a Web Socket Client.
|
int |
getHeaderSize() |
ByteBuffer |
getMaskedKeyBuffer() |
WebSocketMessage.Opcode |
getOpcode() |
ByteBuffer |
getPayloadAsByteBuffer() |
int |
getPayloadSize() |
boolean |
isFin() |
void |
setFin(boolean fin)
Mark whether the complete payload of the message is present
|
void |
setHeader(ByteBuffer header) |
void |
setMaskedKeyBuffer(ByteBuffer maskedKeyBuffer)
Set the mask key of the messages received from WebSocketPeers
|
void |
setOpcode(WebSocketMessage.Opcode opcode) |
void |
setPayloadSize(int payloadSize)
Set the actual number of bytes present in the ByteBuffer which contains the
unmasked payload data
|
ByteBuffer getPayloadAsByteBuffer()
ByteBuffer
which contains the unmasked payload of the messageWebSocketMessage.Opcode getOpcode()
WebSocketMessage.Opcode
of the messageByteBuffer getHeader()
ByteBuffer
that has the header field which corresponds to the
unmasked payload of this message.
NOTE: This method will return null if it is invoked prior to the invocation
of setHeader(ByteBuffer)
int getHeaderSize()
setHeader(ByteBuffer)
method. Otherwise it will return the
actual number of bytes in the ByteBuffer which contains the header.int getPayloadSize()
void setPayloadSize(int payloadSize)
payloadSize
- number of bytes in the payloadvoid setOpcode(WebSocketMessage.Opcode opcode)
opcode
- OpCode of this messagevoid setHeader(ByteBuffer header)
header
- ByteBuffer which contains the header fields, which corresponds
to the unmasked payload in this messagegetHeader()
boolean isFin()
void setFin(boolean fin)
fin
- true if the payload is complete and false otherwisevoid setMaskedKeyBuffer(ByteBuffer maskedKeyBuffer)
maskedKeyBuffer
- ByteBuffer which contains the masked keyByteBuffer getMaskedKeyBuffer()
Copyright © 2010–2016 AdroitLogic. All rights reserved.