Class CipherPacketWriter

java.lang.Object
naga.packetwriter.CipherPacketWriter
All Implemented Interfaces:
PacketWriter

public class CipherPacketWriter extends Object implements PacketWriter
Example Writer that encrypts the outgoing stream using a Cipher object.
Author:
Christoffer Lerno
  • Constructor Details

    • CipherPacketWriter

      public CipherPacketWriter(Cipher cipher, PacketWriter packetWriter)
  • Method Details

    • getPacketWriter

      public PacketWriter getPacketWriter()
    • setPacketWriter

      public void setPacketWriter(PacketWriter packetWriter)
    • write

      public ByteBuffer[] write(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.