Constructor and Description |
---|
IPPacket(int maximum,
java.net.InetAddress group,
int port)
Creates a new packet with the specified length.
|
Modifier and Type | Method and Description |
---|---|
java.net.DatagramPacket |
getPacket()
Returns the internal datagram packet of this packet.
|
byte[] |
getPayload()
Returns the payload of the packet.
|
void |
setPayload(byte[] payload)
Sets the payload of the packet.
|
public IPPacket(int maximum, java.net.InetAddress group, int port)
maximum
- The maximum length of the data packet.group
- The group to join.port
- The port of the socket.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 packet length is
exceeded.java.lang.NullPointerException
- Thrown if the payload is null.public java.net.DatagramPacket getPacket()