Class FramedataImpl1
java.lang.Object
org.java_websocket.framing.FramedataImpl1
- All Implemented Interfaces:
Framedata
- Direct Known Subclasses:
ControlFrame, DataFrame
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanIndicates that this is the final fragment in a message.private OpcodeDefines the interpretation of the "Payload data".private booleanIndicates that the rsv1 bit is set or notprivate booleanIndicates that the rsv2 bit is set or notprivate booleanIndicates that the rsv3 bit is set or notprivate booleanDefines whether the "Payload data" is masked.private ByteBufferThe unmasked "Payload data" which was sent in this frame -
Constructor Summary
ConstructorsConstructorDescriptionFramedataImpl1(Opcode op) Constructor for a FramedataImpl without any attributes set apart from the opcode -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends an additional frame to the current framebooleanstatic FramedataImpl1Get a frame with a specific opcodeDefines the interpretation of the "Payload data".The "Payload data" which was sent in this framebooleanDefines whether the "Payload data" is masked.inthashCode()booleanisFin()Indicates that this is the final fragment in a message.booleanisRSV1()Indicates that this frame has the rsv1 bit set.booleanisRSV2()Indicates that this frame has the rsv2 bit set.booleanisRSV3()Indicates that this frame has the rsv3 bit set.abstract voidisValid()Check if the frame is valid due to specificationvoidsetFin(boolean fin) Set the fin of this frame to the provided booleanvoidsetPayload(ByteBuffer payload) Set the payload of this frame to the provided payloadvoidsetRSV1(boolean rsv1) Set the rsv1 of this frame to the provided booleanvoidsetRSV2(boolean rsv2) Set the rsv2 of this frame to the provided booleanvoidsetRSV3(boolean rsv3) Set the rsv3 of this frame to the provided booleanvoidsetTransferemasked(boolean transferemasked) Set the tranferemask of this frame to the provided booleantoString()
-
Field Details
-
fin
private boolean finIndicates that this is the final fragment in a message. -
optcode
Defines the interpretation of the "Payload data". -
unmaskedpayload
The unmasked "Payload data" which was sent in this frame -
transferemasked
private boolean transferemaskedDefines whether the "Payload data" is masked. -
rsv1
private boolean rsv1Indicates that the rsv1 bit is set or not -
rsv2
private boolean rsv2Indicates that the rsv2 bit is set or not -
rsv3
private boolean rsv3Indicates that the rsv3 bit is set or not
-
-
Constructor Details
-
FramedataImpl1
Constructor for a FramedataImpl without any attributes set apart from the opcode- Parameters:
op- the opcode to use
-
-
Method Details
-
isValid
Check if the frame is valid due to specification- Throws:
InvalidDataException- thrown if the frame is not a valid frame
-
isRSV1
-
isRSV2
-
isRSV3
-
isFin
-
getOpcode
-
getTransfereMasked
public boolean getTransfereMasked()Description copied from interface:FramedataDefines whether the "Payload data" is masked.- Specified by:
getTransfereMaskedin interfaceFramedata- Returns:
- true, "Payload data" is masked
-
getPayloadData
Description copied from interface:FramedataThe "Payload data" which was sent in this frame- Specified by:
getPayloadDatain interfaceFramedata- Returns:
- the "Payload data" as ByteBuffer
-
append
-
toString
-
setPayload
Set the payload of this frame to the provided payload- Parameters:
payload- the payload which is to set
-
setFin
public void setFin(boolean fin) Set the fin of this frame to the provided boolean- Parameters:
fin- true if fin has to be set
-
setRSV1
public void setRSV1(boolean rsv1) Set the rsv1 of this frame to the provided boolean- Parameters:
rsv1- true if rsv1 has to be set
-
setRSV2
public void setRSV2(boolean rsv2) Set the rsv2 of this frame to the provided boolean- Parameters:
rsv2- true if rsv2 has to be set
-
setRSV3
public void setRSV3(boolean rsv3) Set the rsv3 of this frame to the provided boolean- Parameters:
rsv3- true if rsv3 has to be set
-
setTransferemasked
public void setTransferemasked(boolean transferemasked) Set the tranferemask of this frame to the provided boolean- Parameters:
transferemasked- true if transferemasked has to be set
-
get
Get a frame with a specific opcode- Parameters:
opcode- the opcode representing the frame- Returns:
- the frame with a specific opcode
-
equals
-
hashCode
-