|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PacketReader
Interface for packet reader plugins to assist a socket in reading.
To implement a packet reader, the reader has to offer the currently
used byte buffer whenever the NIO service calls PacketReader#getBuffer()
PacketReader#getNextPacket()
should return a byte-array if it is possible to create
one from the data loaded into the buffer(s).
Note that getNextPacket() will be called repeatedly until it returns null.
Method Summary | |
---|---|
java.nio.ByteBuffer |
getBuffer()
Return the currently used byte buffer. |
byte[] |
getNextPacket()
Return the next packet constructed from the data read in the buffers. |
Method Detail |
---|
java.nio.ByteBuffer getBuffer() throws ProtocolViolationException
The reader is guaranteed not to have this method called more than once before a
call to PacketReader#getNextPacket()
is made.
ProtocolViolationException
- if a protocol violation was detected when
reading preparing the buffer.byte[] getNextPacket() throws ProtocolViolationException
This call may or may not have been proceeded by a call to getBuffer().
The calling thread will call this method repeatedly until it returns null.
ProtocolViolationException
- if a protocol violation was detected when
parsing the next packet.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |