Package naga
Class SSLPacketHandler
java.lang.Object
naga.SSLPacketHandler
- All Implemented Interfaces:
PacketReader,PacketWriter
Undocumented Class
- Author:
- Christoffer Lerno
-
Field Summary
Fields inherited from interface naga.PacketReader
SKIP_PACKET -
Constructor Summary
ConstructorsConstructorDescriptionSSLPacketHandler(SSLEngine engine, NIOSocket socket, naga.SSLSocketChannelResponder responder) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbyte[]nextPacket(ByteBuffer byteBuffer) Create a new packet using the ByteBuffer given.voidsetReader(PacketReader reader) voidsetWriter(PacketWriter writer) write(ByteBuffer[] byteBuffers) Convert the incoming bytes to the bytes to be serialized.
-
Constructor Details
-
SSLPacketHandler
-
-
Method Details
-
getReader
-
setReader
-
getWriter
-
setWriter
-
nextPacket
Description copied from interface:PacketReaderCreate a new packet using the ByteBuffer given.If there isn't sufficient data to construct a packet, return null.
- Specified by:
nextPacketin interfacePacketReader- 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.
-
write
Description copied from interface:PacketWriterConvert the incoming bytes to the bytes to be serialized.- Specified by:
writein interfacePacketWriter- Parameters:
byteBuffers- an array of ByteBuffers containing data the bytes to be written.- Returns:
- the resulting array of ByteBuffers.
-
getSSLEngine
-
closeEngine
public void closeEngine() -
isEncrypted
public boolean isEncrypted()
-