public class FragmentAllocatePacket extends java.lang.Object implements IPacket
FragmentAllocationPacket
.
Major ID: 254 Minor ID: 1
Constructor and Description |
---|
FragmentAllocatePacket(java.lang.Integer fragmentCount,
java.util.UUID allocationID)
Constructs a new FragmentAllocatePacket given the fragment count and allocation UUID.
|
Modifier and Type | Method and Description |
---|---|
java.util.UUID |
getAllocationID()
Gets the allocation ID or null.
|
java.lang.Integer |
getFragmentCount()
Gets the number of fragments 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.
|
public FragmentAllocatePacket(java.lang.Integer fragmentCount, java.util.UUID allocationID)
fragmentCount
- The number of fragments to allocate.allocationID
- The allocation ID.java.lang.IllegalArgumentException
- fragmentCount is less than 1.public boolean isValid()
public PacketProtocolInformation getProtocol()
getProtocol
in interface IPacket
public static PacketProtocolInformation getTheProtocol()
public byte[] savePayload() throws PacketException
savePayload
in interface IPacket
PacketException
- An Exception has occurred.public void loadPayload(byte[] packetData) throws PacketException
loadPayload
in interface IPacket
packetData
- The packet payload data.java.lang.NullPointerException
- The new store data is null.PacketException
- An Exception has occurred.public java.lang.Integer getFragmentCount()
public java.util.UUID getAllocationID()