类 BinaryMessage
- java.lang.Object
- org.springframework.web.socket.AbstractWebSocketMessage<ByteBuffer>
- org.springframework.web.socket.BinaryMessage
- 所有已实现的接口:
WebSocketMessage<ByteBuffer>
public final class BinaryMessage extends AbstractWebSocketMessage<ByteBuffer>
A binary WebSocket message.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 BinaryMessage(byte[] payload)
Create a new binary WebSocket message with the given byte[] payload.BinaryMessage(byte[] payload, boolean isLast)
Create a new binary WebSocket message with the given byte[] payload representing the full or partial message content.BinaryMessage(byte[] payload, int offset, int length, boolean isLast)
Create a new binary WebSocket message by wrapping an existing byte array.BinaryMessage(ByteBuffer payload)
Create a new binary WebSocket message with the given ByteBuffer payload.BinaryMessage(ByteBuffer payload, boolean isLast)
Create a new binary WebSocket message with the given payload representing the full or partial message content.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 int
getPayloadLength()
Return the number of bytes contained in the message.protected String
toStringPayload()
从类继承的方法 org.springframework.web.socket.AbstractWebSocketMessage
equals, getPayload, hashCode, isLast, toString
构造器详细资料
BinaryMessage
public BinaryMessage(ByteBuffer payload)
Create a new binary WebSocket message with the given ByteBuffer payload.- 参数:
payload
- the non-null payload
BinaryMessage
public BinaryMessage(ByteBuffer payload, boolean isLast)
Create a new binary WebSocket message with the given payload representing the full or partial message content. When theisLast
boolean flag is set tofalse
the message is sent as partial content and more partial messages will be expected until the boolean flag is set totrue
.- 参数:
payload
- the non-null payloadisLast
- if the message is the last of a series of partial messages
BinaryMessage
public BinaryMessage(byte[] payload)
Create a new binary WebSocket message with the given byte[] payload.- 参数:
payload
- a non-null payload; note that this value is not copied so care must be taken not to modify the array.
BinaryMessage
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 theisLast
boolean flag is set tofalse
the message is sent as partial content and more partial messages will be expected until the boolean flag is set totrue
.- 参数:
payload
- a non-null payload; note that this value is not copied so care must be taken not to modify the array.isLast
- if the message is the last of a series of partial messages
BinaryMessage
public BinaryMessage(byte[] payload, int offset, int length, boolean isLast)
Create a new binary WebSocket message by wrapping an existing byte array.- 参数:
payload
- a non-null payload; note that this value is not copied so care must be taken not to modify the array.offset
- the offset into the array where the payload startslength
- the length of the array considered for the payloadisLast
- if the message is the last of a series of partial messages
方法详细资料
getPayloadLength
public int getPayloadLength()
从接口复制的说明:WebSocketMessage
Return the number of bytes contained in the message.
toStringPayload
protected String toStringPayload()