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

naga.packetwriter

## Class CipherPacketWriter

- java.lang.Object
- - naga.packetwriter.CipherPacketWriter

- All Implemented Interfaces:
    PacketWriter

      public class CipherPacketWriter
      extends java.lang.Object
      implements PacketWriter

  Example Writer that encrypts the outgoing stream using a Cipher object.
  Author:
    Christoffer Lerno

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CipherPacketWriter(javax.crypto.Cipher cipher, PacketWriter packetWriter)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PacketWriter` | `getPacketWriter()`
    `void` | `setPacketWriter(PacketWriter packetWriter)`
    `java.nio.ByteBuffer[]` | `write(java.nio.ByteBuffer[] byteBuffer)` Convert the incoming bytes to the bytes to be serialized.

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

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

- - ### Constructor Detail

    - #### CipherPacketWriter

          public CipherPacketWriter(javax.crypto.Cipher cipher,
                            PacketWriter packetWriter)

  - ### Method Detail

    - #### getPacketWriter

          public PacketWriter getPacketWriter()

    - #### setPacketWriter

          public void setPacketWriter(PacketWriter packetWriter)

    - #### write

          public java.nio.ByteBuffer[] write(java.nio.ByteBuffer[] byteBuffer)

      Description copied from interface: `PacketWriter`
      Convert the incoming bytes to the bytes to be serialized.
      Specified by:
        `write` in interface `PacketWriter`
      Parameters:
        `byteBuffer` - an array of ByteBuffers containing data the bytes to be written.
      Returns:
        the resulting array of ByteBuffers.