public class TextData extends Object implements Data
TextData
object represents a text payload for
a WebScoket frame. This can be used to send any type of data. If
however it is used to send binary data then it is encoded as UTF-8.DataFrame
Constructor and Description |
---|
TextData(String data)
Constructor for the
TextData object. |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBinary()
This returns the binary payload that is to be sent with a frame.
|
String |
getText()
This returns the text payload that is to be sent with a frame.
|
public TextData(String data)
TextData
object. It requires
an text string that will be sent as UTF-8 within a frame.data
- the text string representing the frame payloadpublic byte[] getBinary()
public String getText()
Copyright © 2024. All rights reserved.