Package naga.packetreader
Class RawPacketReader
java.lang.Object
naga.packetreader.RawPacketReader
- All Implemented Interfaces:
PacketReader
This packet reader reads as many bytes as possible from the stream
and then bundles those bytes into a packet.
- Author:
- Christoffer Lerno
-
Field Summary
FieldsFields inherited from interface naga.PacketReader
SKIP_PACKET
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
nextPacket
(ByteBuffer byteBuffer) Create a new packet using the ByteBuffer given.
-
Field Details
-
INSTANCE
-
-
Method Details
-
nextPacket
Description copied from interface:PacketReader
Create a new packet using the ByteBuffer given.If there isn't sufficient data to construct a packet, return null.
- Specified by:
nextPacket
in interfacePacketReader
- Parameters:
byteBuffer
- the byte buffer to use.- Returns:
- the new packet created, or null if no packet could be created. The method will continously be called until nextPacket returns null.
- Throws:
ProtocolViolationException
- is there was an error constructing the packet.
-