public class Frame extends Object
Modifier and Type | Field and Description |
---|---|
protected byte[] |
payload
Payload data
|
static int |
RSV1
The reserved bit 1
|
static int |
RSV2
The reserved bit 2
|
static int |
RSV3
The reserved bit 3
|
Modifier | Constructor and Description |
---|---|
protected |
Frame(Opcode opcode,
boolean finalFragment,
int rsvBits,
byte[] payload)
Constructs a generic Web Socket frame.
|
Modifier and Type | Method and Description |
---|---|
Opcode |
getOpcode()
Returns the type (opcode) of this frame.
|
byte[] |
getPayload()
Returns the payload data in this frame.
|
int |
getPayloadLength()
Return the length of the payload data in this frame.
|
int |
getRsvBits()
Returns the reserved bits for extensions or future versions.
|
boolean |
isFinalFragment()
Tells if this frame is the final fragment in a message.
|
boolean |
isRsvBit1()
Tells if the reserved bit 1 is set
|
boolean |
isRsvBit2()
Tells if the reserved bit 2 is set
|
boolean |
isRsvBit3()
Tells if the reserved bit 3 is set
|
public static final int RSV1
public static final int RSV2
public static final int RSV3
protected final byte[] payload
protected Frame(Opcode opcode, boolean finalFragment, int rsvBits, byte[] payload)
opcode
- the type of created framefinalFragment
- determines if the created frame is the final fragment in
a messagersvBits
- reserved bits for extensions or future versionspayload
- payload datapublic boolean isFinalFragment()
true
if this frame is the final fragmentpublic int getRsvBits()
public boolean isRsvBit1()
true
if the reserved bit 1 is setpublic boolean isRsvBit2()
true
if the reserved bit 2 is setpublic boolean isRsvBit3()
true
if the reserved bit 3 is setpublic Opcode getOpcode()
public byte[] getPayload()
public int getPayloadLength()
Copyright © 2017–2022 SNF4J.ORG. All rights reserved.