Package org.simpleframework.http.socket
Class TextData
- java.lang.Object
-
- org.simpleframework.http.socket.TextData
-
-
Field Summary
Fields Modifier and Type Field Description private DataConverter
converter
This is used to convert the text payload to a byte array.private java.lang.String
data
This is the text string representing a frame payload.
-
Constructor Summary
Constructors Constructor Description TextData(java.lang.String data)
Constructor for theTextData
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBinary()
This returns the binary payload that is to be sent with a frame.java.lang.String
getText()
This returns the text payload that is to be sent with a frame.
-
-
-
Field Detail
-
converter
private final DataConverter converter
This is used to convert the text payload to a byte array.
-
data
private final java.lang.String data
This is the text string representing a frame payload.
-
-
Method Detail
-
getBinary
public byte[] getBinary()
This returns the binary payload that is to be sent with a frame. It contains no headers or other meta data. If the original data was text this converts it to UTF-8.
-
getText
public java.lang.String getText()
This returns the text payload that is to be sent with a frame. It contains no header information or meta data. Caution should be used with this method as binary payloads will encode to garbage when decoded as UTF-8.
-
-