Frame Class

Used to represent a message sent or received via a websocket connection. Websocket messages are encapsulated in frames. There are 2 types of frames: Control Frames (e.g. CloseFrame) and Data Frames (e.g. TextFrame). This class provides abstract methods to create frames and includes subclasses that implement all standard frame types defined in RFC 6455.

Constructors

public Frame( javaxt.websocket.Frame.Opcode op )

Methods

append( javaxt.websocket.Frame nextframe ) returns void
createFrame( String text, boolean mask ) returns javaxt.websocket.Frame
get( javaxt.websocket.Frame.Opcode opcode ) returns javaxt.websocket.Frame
Get a frame with a specific opcode
opcodethe opcode representing the frame
getByteBuffer( boolean mask ) returns java.nio.ByteBuffer
getOpcode( ) returns javaxt.websocket.Frame.Opcode
getPayloadData( ) returns java.nio.ByteBuffer
getTransfereMasked( ) returns boolean
isFin( ) returns boolean
isRSV1( ) returns boolean
isRSV2( ) returns boolean
isRSV3( ) returns boolean
isValid( ) returns void
Check if the frame is valid due to specification
setFin( boolean fin ) returns void
Set the fin of this frame to the provided boolean
fintrue if fin has to be set
setPayload( java.nio.ByteBuffer payload ) returns void
Set the payload of this frame to the provided payload
payloadthe payload which is to set
setRSV1( boolean rsv1 ) returns void
Set the rsv1 of this frame to the provided boolean
rsv1true if fin has to be set
setRSV2( boolean rsv2 ) returns void
Set the rsv2 of this frame to the provided boolean
rsv2true if fin has to be set
setRSV3( boolean rsv3 ) returns void
Set the rsv3 of this frame to the provided boolean
rsv3true if fin has to be set
setTransferemasked( boolean transferemasked ) returns void
Set the tranferemask of this frame to the provided boolean
transferemaskedtrue if transferemasked has to be set
toString( ) returns String
translateSingleFrame( java.nio.ByteBuffer buffer ) returns javaxt.websocket.Frame