Package naga
Interface PacketReader
-
- All Known Implementing Classes:
AsciiLinePacketReader
,CipherPacketReader
,DelimiterPacketReader
,RawPacketReader
,RegularPacketReader
,SSLPacketHandler
,StreamCipherPacketReader
,ZeroDelimitedPacketReader
public interface PacketReader
Interface for packet reader plugins to assist a socket in reading.PacketReaders are in general intended to help splitting
- Author:
- Christoffer Lerno
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]
SKIP_PACKET
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
nextPacket(java.nio.ByteBuffer byteBuffer)
Create a new packet using the ByteBuffer given.
-
-
-
Method Detail
-
nextPacket
byte[] nextPacket(java.nio.ByteBuffer byteBuffer) throws ProtocolViolationException
Create a new packet using the ByteBuffer given.If there isn't sufficient data to construct a packet, return null.
- 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.
-
-