A WebSocket frame that represents either text or binary data.
A WebSocket message is composed of one or more WebSocket frames.
If there is a just a single frame in the message then a single text or binary frame should be created with final = true.
If there are more than one frames in the message, then the first frame should be a text or binary frame with final = false, followed by one or more continuation frames. The last continuation frame should have final = true.
Constructor and description |
---|
WebSocketFrame
(java.lang.Object delegate) |
Type | Name and description |
---|---|
Buffer |
binaryData() @return
|
static WebSocketFrame |
binaryFrame(Buffer data, boolean isFinal) Create a binary WebSocket frame. |
static WebSocketFrame |
continuationFrame(Buffer data, boolean isFinal) Create a continuation frame |
java.lang.Object |
getDelegate() |
boolean |
isBinary() @return
|
boolean |
isContinuation() @return
|
boolean |
isFinal()
|
boolean |
isText() @return
|
java.lang.String |
textData()
|
static WebSocketFrame |
textFrame(java.lang.String str, boolean isFinal) Create a text WebSocket frame. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Create a binary WebSocket frame.
data
- the data for the frameisFinal
- true if it's the final frame in the WebSocket messageCreate a continuation frame
data
- the data for the frameisFinal
- true if it's the final frame in the WebSocket message
Create a text WebSocket frame.
str
- the string for the frameisFinal
- true if it's the final frame in the WebSocket message