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

naga.packetreader

## Class StreamCipherPacketReader

- java.lang.Object
- - naga.packetreader.StreamCipherPacketReader

- All Implemented Interfaces:
    PacketReader

      public class StreamCipherPacketReader
      extends java.lang.Object
      implements PacketReader

  Undocumented Class
  Author:
    Christoffer Lerno

- - ### Field Summary

    - ### Fields inherited from interface naga.PacketReader

      `SKIP_PACKET`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreamCipherPacketReader(javax.crypto.Cipher cipher, PacketReader reader)`

  - ### Method Summary

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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StreamCipherPacketReader

          public StreamCipherPacketReader(javax.crypto.Cipher cipher,
                                  PacketReader reader)

  - ### Method Detail

    - #### nextPacket

          public byte[] nextPacket(java.nio.ByteBuffer byteBuffer)
                            throws ProtocolViolationException

      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 interface `PacketReader`
      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.