public final class BinaryMessage extends WebSocketMessage<java.nio.ByteBuffer>
WebSocketMessage that contains a binary ByteBuffer payload.| Constructor and Description |
|---|
BinaryMessage(byte[] payload)
Create a new
BinaryMessage instance. |
BinaryMessage(byte[] payload,
boolean isLast)
Create a new
BinaryMessage instance. |
BinaryMessage(byte[] payload,
int offset,
int len,
boolean isLast)
Create a new
BinaryMessage instance by wrapping an existing byte array. |
BinaryMessage(java.nio.ByteBuffer payload)
Create a new
BinaryMessage instance. |
BinaryMessage(java.nio.ByteBuffer payload,
boolean isLast)
Create a new
BinaryMessage instance. |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getByteArray()
Returns access to the message payload as a byte array.
|
protected int |
getPayloadSize() |
equals, getPayload, hashCode, isLast, toStringpublic BinaryMessage(java.nio.ByteBuffer payload)
BinaryMessage instance.payload - a non-null payloadpublic BinaryMessage(java.nio.ByteBuffer payload,
boolean isLast)
BinaryMessage instance.payload - a non-null payloadisLast - if the message is the last of a series of partial messagespublic BinaryMessage(byte[] payload)
BinaryMessage instance.payload - a non-null payloadpublic BinaryMessage(byte[] payload,
boolean isLast)
BinaryMessage instance.payload - a non-null payloadisLast - if the message is the last of a series of partial messagespublic BinaryMessage(byte[] payload,
int offset,
int len,
boolean isLast)
BinaryMessage instance by wrapping an existing byte array.payload - a non-null payload, NOTE: this value is not copied so care must be
taken not to modify the array.offset - the offet into the array where the payload startslen - the length of the array considered for the payloadisLast - if the message is the last of a series of partial messagespublic byte[] getByteArray()
protected int getPayloadSize()
getPayloadSize in class WebSocketMessage<java.nio.ByteBuffer>