T - the generic typepublic class MessagePacket<T> extends Packet
TYPEBYTECOUNT| Constructor and Description |
|---|
MessagePacket(byte packetId)
Instantiates a new object packet.
|
MessagePacket(byte[] content)
Instantiates a new object packet.
|
MessagePacket(MessageType type,
T object)
Instantiates a new object packet.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getData()
Gets the data.
|
T |
getObject()
Gets the object.
|
int |
getSize()
Gets the size.
|
getPacketId, readData, setDatapublic MessagePacket(byte packetId)
packetId - the packet idpublic MessagePacket(byte[] content)
content - the contentpublic MessagePacket(MessageType type, T object)
type - the typeobject - the object