public class Frame extends Object
TODO: - masking (isMask is currently ignored) - validation - payloadLength is limited to int
Modifier and Type | Class and Description |
---|---|
static class |
Frame.Builder
Frame builder.
|
Modifier | Constructor and Description |
---|---|
protected |
Frame(Frame frame)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
static Frame.Builder |
builder()
Create new
Frame.Builder . |
static Frame.Builder |
builder(Frame frame)
Create new
Frame.Builder based on provided frame. |
Integer |
getMaskingKey()
Get masking key.
|
byte |
getOpcode()
Get opcode.
|
byte[] |
getPayloadData()
Get payload data.
|
long |
getPayloadLength()
Get payload length.
|
boolean |
isControlFrame()
Get information about frame type.
|
boolean |
isFin()
Get FIN value.
|
boolean |
isMask()
Currently not used.
|
boolean |
isRsv1()
GET RSV1 value.
|
boolean |
isRsv2()
GET RSV2 value.
|
boolean |
isRsv3()
GET RSV3 value.
|
String |
toString() |
protected Frame(Frame frame)
frame
- copied frame.public boolean isFin()
true
when FIN flag is set, false
otherwise.public boolean isRsv1()
true
when RSV1 flag is set, false
otherwise.public boolean isRsv2()
true
when RSV2 flag is set, false
otherwise.public boolean isRsv3()
true
when RSV3 flag is set, false
otherwise.public boolean isMask()
public byte getOpcode()
public long getPayloadLength()
public Integer getMaskingKey()
null
when the frame should not be masked.public byte[] getPayloadData()
Frame
instance. If you need to modify
payload, you have to create new instance, see Frame.Builder#Frame(Frame)
. Length of returned array will
be always same as getPayloadLength()
.public boolean isControlFrame()
true
when this frame is control (close, ping, pong) frame, false
otherwise.public static Frame.Builder builder()
Frame.Builder
.public static Frame.Builder builder(Frame frame)
Frame.Builder
based on provided frame.frame
- frame used as a base for building new frame.Copyright © 2012-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.