PacketReader (Naga API)
Date: 2016-06-28

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 and Description
    --- | ---
    `static byte[]` | `SKIP_PACKET`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `nextPacket(java.nio.ByteBuffer byteBuffer)` Create a new packet using the ByteBuffer given.

- - ### Field Detail

    - #### SKIP_PACKET

          static final byte[] SKIP_PACKET

  - ### 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.