public interface PacketFactory<P extends Packet<?>>
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHandle(byte[] data)
Checks whether this PacketFactory is able to handle the incoming raw byte data.
|
P |
read(byte[] data)
Construct a packet out of the raw byte data.
|
P read(byte[] data) throws Buffer.BufferException, java.io.IOException
data - the byte array containing the full packet dataBuffer.BufferExceptionjava.io.IOExceptionboolean canHandle(byte[] data)
data - the byte array containing the full packet dataread(byte[]) will result in a packet, false otherwise.