public abstract class SimplePacket extends java.lang.Object implements PacketIF
Modifier and Type | Field and Description |
---|---|
static byte |
HEARTBEAT
The HEARTBEAT packet header
|
static byte |
PING
The PING packet header
|
static byte |
PONG
The PONG packet header
|
static byte |
UNKNOWN
The UNKNOWN packet header
|
Constructor and Description |
---|
SimplePacket(java.lang.String name)
Create a new simple (one-byte long) packet
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getPacketName()
Get the name of the packet (String representation)
|
void |
reconstruct(java.nio.ByteBuffer source)
Simple packets are 1-byte packets and thus do not require any
reconstruction
|
public static final byte PING
public static final byte PONG
public static final byte HEARTBEAT
public static final byte UNKNOWN
public SimplePacket(java.lang.String name)
name
- The string representation (name) of the packetpublic void reconstruct(java.nio.ByteBuffer source)
reconstruct
in interface PacketIF
source
- The data source to reconstruct the packet frompublic java.lang.String getPacketName()