Package org.glassfish.tyrus.core.frame
Class Frame.Builder
java.lang.Object
org.glassfish.tyrus.core.frame.Frame.Builder
- Enclosing class:
Frame
Frame builder.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build new frame.fin
(boolean fin) Set FIN flag.mask
(boolean mask) Currently not used.maskingKey
(Integer maskingKey) Set masking key.opcode
(byte opcode) Set opcode.payloadData
(byte[] payloadData) Set payload data.payloadLength
(long payloadLength) Set payload length.rsv1
(boolean rsv1) Set RSV1 flag.rsv2
(boolean rsv2) Set RSV2 flag.rsv3
(boolean rsv3) Set RSV3 flag.
-
Constructor Details
-
Builder
public Builder()Constructor. -
Builder
Constructor.- Parameters:
frame
- frame used as a base for building new frame.
-
-
Method Details
-
build
Build new frame.- Returns:
- built frame.
-
fin
Set FIN flag.- Parameters:
fin
- value to be set as FIN.- Returns:
- updated
Frame.Builder
instance.
-
rsv1
Set RSV1 flag.- Parameters:
rsv1
- value to be set as RSV1.- Returns:
- updated
Frame.Builder
instance.
-
rsv2
Set RSV2 flag.- Parameters:
rsv2
- value to be set as RSV2.- Returns:
- updated
Frame.Builder
instance.
-
rsv3
Set RSV3 flag.- Parameters:
rsv3
- value to be set as RSV3.- Returns:
- updated
Frame.Builder
instance.
-
mask
Currently not used.- Parameters:
mask
- not used.- Returns:
- updated
Frame.Builder
instance.
-
opcode
Set opcode.- Parameters:
opcode
- opcode to be set. (4 bits).- Returns:
- updated
Frame.Builder
instance.
-
payloadLength
Set payload length.Payload length is automatically set to payloadData length when
payloadData(byte[])
is called. This method can limit the data used for this frame by setting smaller value than payloadData.length.- Parameters:
payloadLength
- payload length. Must not be greater than payloadData.length.- Returns:
- updated
Frame.Builder
instance. - See Also:
-
maskingKey
Set masking key. Default value isnull
.- Parameters:
maskingKey
- masking key.- Returns:
- updated
Frame.Builder
instance.
-
payloadData
Set payload data.payloadLength(long)
is also updated with payloadData.length.- Parameters:
payloadData
- data to be set.- Returns:
- updated
Frame.Builder
instance. - See Also:
-