| Constructor and Description |
|---|
DataPayload()
Creates a data payload used for reading.
|
DataPayload(byte[] data)
Creates a data payload intended for writing.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getData() |
int |
getSize()
Gets the payload size in bytes.
|
byte |
getType()
Gets the type of this payload as defined in
UtpProtocol |
void |
process(UtpPacket packet,
UtpSocketImpl socket)
Process the packet.
|
void |
read(InStream inStream)
Reads the payload.
|
String |
toString() |
void |
write(OutStream outStream)
Writes the payload.
|
public DataPayload(byte[] data)
data - The data to send as payload.public DataPayload()
public byte getType()
IPayloadUtpProtocolpublic void read(InStream inStream)
IPayloadpublic void write(OutStream outStream)
IPayloadpublic void process(UtpPacket packet, UtpSocketImpl socket) throws IOException
IPayloadprocess in interface IPayloadpacket - The packet header associated to this payload.socket - The socket which received the packet.IOExceptionpublic byte[] getData()
public int getSize()
IPayloadCopyright © 2016. All rights reserved.