public final class TextMessage extends AbstractWebSocketMessage<java.lang.String>
Constructor and Description |
---|
TextMessage(byte[] payload)
Create a new text WebSocket message from the given byte[].
|
TextMessage(java.lang.CharSequence payload)
Create a new text WebSocket message from the given CharSequence payload.
|
TextMessage(java.lang.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 java.lang.String |
toStringPayload() |
equals, getPayload, hashCode, isLast, toString
public TextMessage(java.lang.CharSequence payload)
payload
- the non-null payloadpublic TextMessage(byte[] payload)
payload
- the non-null payloadpublic TextMessage(java.lang.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 java.lang.String toStringPayload()
toStringPayload
in class AbstractWebSocketMessage<java.lang.String>