public class FragmentAllocationPacket extends FragmentPIDPacket
FragmentAllocatePacket
.
Major ID: 254 Minor ID: 2
Constructor and Description |
---|
FragmentAllocationPacket(java.lang.Integer packetID,
java.util.UUID allocationID,
java.lang.Boolean success)
Constructs a new FragmentAllocationPacket given the packet ID, allocation ID and if it's successful.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allocationSuccessful()
Checks if the allocation is successful.
|
java.util.UUID |
getAllocationID()
Gets the allocation ID or null.
|
PacketProtocolInformation |
getProtocol()
Gets the protocol information.
|
static PacketProtocolInformation |
getTheProtocol()
Gets the protocol information statically.
|
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
public FragmentAllocationPacket(java.lang.Integer packetID, java.util.UUID allocationID, java.lang.Boolean success)
packetID
- The packet ID.allocationID
- The allocation ID.success
- The allocation was successful.java.lang.IllegalArgumentException
- packetID is less than 0.public boolean isValid()
isValid
in interface IPacket
isValid
in class FragmentPIDPacket
public PacketProtocolInformation getProtocol()
public static PacketProtocolInformation getTheProtocol()
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 boolean allocationSuccessful()
public java.util.UUID getAllocationID()