Top Description Constructors Methods
org.springframework.web.socket

public final Class BinaryMessage

extends AbstractWebSocketMessage<ByteBuffer>
Class Inheritance
Imports
java.nio.ByteBuffer

A binary WebSocket message.
Author
Rossen Stoyanchev
Since
4.0

Constructor Summary

AccessConstructor and Description
public
BinaryMessage(ByteBuffer
the non-null payload
payload
)

Create a new binary WebSocket message with the given ByteBuffer payload.

public
BinaryMessage(ByteBuffer
the non-null payload
payload
,
boolean
if the message is the last of a series of partial messages
isLast
)

Create a new binary WebSocket message with the given payload representing the full or partial message content.

public
BinaryMessage(byte[]
a non-null payload; note that this value is not copied so care must be taken not to modify the array.
payload
)

Create a new binary WebSocket message with the given byte[] payload.

public
BinaryMessage(byte[]
a non-null payload; note that this value is not copied so care must be taken not to modify the array.
payload
,
boolean
if the message is the last of a series of partial messages
isLast
)

Create a new binary WebSocket message with the given byte[] payload representing the full or partial message content.

public
BinaryMessage(byte[]
a non-null payload; note that this value is not copied so care must be taken not to modify the array.
payload
,
int
the offset into the array where the payload starts
offset
,
int
the length of the array considered for the payload
length
,
boolean
if the message is the last of a series of partial messages
isLast
)

Create a new binary WebSocket message by wrapping an existing byte array.

Method Summary

Modifier and TypeMethod and Description
public int
getPayloadLength()

Implements org.springframework.web.socket.WebSocketMessage.getPayloadLength.

Return the number of bytes contained in the message.

protected String
Inherited from org.springframework.web.socket.AbstractWebSocketMessage:
equalsgetPayloadhashCodeisLasttoString

Constructor Detail

BinaryMessageback to summary
public BinaryMessage(ByteBuffer payload)

Create a new binary WebSocket message with the given ByteBuffer payload.

Parameters
payload:ByteBuffer

the non-null payload

BinaryMessageback to summary
public BinaryMessage(ByteBuffer payload, boolean isLast)

Create a new binary WebSocket message with the given payload representing the full or partial message content. When the isLast boolean flag is set to false the message is sent as partial content and more partial messages will be expected until the boolean flag is set to true.

Parameters
payload:ByteBuffer

the non-null payload

isLast:boolean

if the message is the last of a series of partial messages

BinaryMessageback to summary
public BinaryMessage(byte[] payload)

Create a new binary WebSocket message with the given byte[] payload.

Parameters
payload:byte[]

a non-null payload; note that this value is not copied so care must be taken not to modify the array.

BinaryMessageback to summary
public BinaryMessage(byte[] payload, boolean isLast)

Create a new binary WebSocket message with the given byte[] payload representing the full or partial message content. When the isLast boolean flag is set to false the message is sent as partial content and more partial messages will be expected until the boolean flag is set to true.

Parameters
payload:byte[]

a non-null payload; note that this value is not copied so care must be taken not to modify the array.

isLast:boolean

if the message is the last of a series of partial messages

BinaryMessageback to summary
public BinaryMessage(byte[] payload, int offset, int length, boolean isLast)

Create a new binary WebSocket message by wrapping an existing byte array.

Parameters
payload:byte[]

a non-null payload; note that this value is not copied so care must be taken not to modify the array.

offset:int

the offset into the array where the payload starts

length:int

the length of the array considered for the payload

isLast:boolean

if the message is the last of a series of partial messages

Method Detail

getPayloadLengthback to summary
public int getPayloadLength()

Implements org.springframework.web.socket.WebSocketMessage.getPayloadLength.

Doc from org.springframework.web.socket.WebSocketMessage.getPayloadLength.

Return the number of bytes contained in the message.

Annotations
@Override
toStringPayloadback to summary
protected String toStringPayload()

Implements abstract org.springframework.web.socket.AbstractWebSocketMessage.toStringPayload.

Annotations
@Override