public abstract class FragmentPIDMSGPacket extends FragmentPIDPacket
Constructor and Description |
---|
FragmentPIDMSGPacket(java.lang.Integer packetID,
java.lang.Integer fragmentID,
byte[] payload)
Constructs a new FragmentPIDMSGPacket given the packet ID, fragment ID and payload.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getFragmentID()
Gets the fragment ID or null.
|
byte[] |
getFragmentMessage()
Gets the fragment message byte array or null.
|
boolean |
isValid()
Gets if the packet is valid.
|
void |
loadPayload(byte[] packetData)
Loads the packet payload from save data.
|
byte[] |
savePayload()
Saves the packet payload to a byte array.
|
getPacketID
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProtocol
public FragmentPIDMSGPacket(java.lang.Integer packetID, java.lang.Integer fragmentID, byte[] payload)
packetID
- The packet ID.fragmentID
- The fragment ID.payload
- The payload to store.java.lang.IllegalArgumentException
- packetID or fragmentID is less than 0.public boolean isValid()
isValid
in interface IPacket
isValid
in class FragmentPIDPacket
public byte[] savePayload() throws PacketException
PacketException
- An Exception has occurred.public void loadPayload(byte[] packetData) throws PacketException
packetData
- The packet payload data.java.lang.NullPointerException
- The new store data is null.PacketException
- An Exception has occurred.public byte[] getFragmentMessage()
public java.lang.Integer getFragmentID()