public class Packet extends java.lang.Object implements IPacket
Constructor and Description |
---|
Packet(int length)
Creates a new packet with an empty payload and
the specified maximum length.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getPayload()
Returns the payload of the packet.
|
void |
setPayload(byte[] payload)
Sets the payload of the packet.
|
public Packet(int length)
length
- The maximum length.public byte[] getPayload()
getPayload
in interface IPacket
public void setPayload(byte[] payload)
setPayload
in interface IPacket
payload
- The payload of the packet.java.lang.IndexOutOfBoundsException
- Thrown if the
maximum packet size is exceeded.