public class BinaryData extends Object implements Data
BinaryData
object represents a binary payload for
a WebScoket frame. This can be used to send any type of data. If
however it is used to send text data then it is decoded as UTF-8.DataFrame
Constructor and Description |
---|
BinaryData(byte[] data)
Constructor for the
BinaryData 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 BinaryData(byte[] data)
BinaryData
object. It requires
an array of binary data that will be send within a frame.data
- the byte array representing the frame payloadpublic byte[] getBinary()
public String getText()
Copyright © 2024. All rights reserved.