Package 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 Description CipherPacketWriter(javax.crypto.Cipher cipher, PacketWriter packetWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PacketWritergetPacketWriter()voidsetPacketWriter(PacketWriter packetWriter)java.nio.ByteBuffer[]write(java.nio.ByteBuffer[] byteBuffer)Convert the incoming bytes to the bytes to be serialized.
-
-
-
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:PacketWriterConvert the incoming bytes to the bytes to be serialized.- Specified by:
writein interfacePacketWriter- Parameters:
byteBuffer- an array of ByteBuffers containing data the bytes to be written.- Returns:
- the resulting array of ByteBuffers.
-
-