public final class TextMessage extends AbstractWebSocketMessage<String>
Constructor and Description |
---|
TextMessage(byte[] payload)
Create a new text WebSocket message from the given byte[].
|
TextMessage(CharSequence payload)
Create a new text WebSocket message from the given CharSequence payload.
|
TextMessage(CharSequence payload,
boolean isLast)
Create a new text WebSocket message with the given payload representing the
full or partial message content.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
asBytes() |
int |
getPayloadLength()
Return the number of bytes contained in the message.
|
protected String |
toStringPayload() |
equals, getPayload, hashCode, isLast, toString
public TextMessage(CharSequence payload)
payload
- the non-null payloadpublic TextMessage(byte[] payload)
payload
- the non-null payloadpublic TextMessage(CharSequence payload, boolean isLast)
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
.payload
- the non-null payloadisLast
- whether this the last part of a series of partial messagespublic int getPayloadLength()
WebSocketMessage
public byte[] asBytes()
protected String toStringPayload()
toStringPayload
in class AbstractWebSocketMessage<String>