Class DelimiterPacketWriter

java.lang.Object
naga.packetwriter.DelimiterPacketWriter
All Implemented Interfaces:
PacketWriter
Direct Known Subclasses:
AsciiLinePacketWriter, ZeroDelimitedPacketWriter

public class DelimiterPacketWriter extends Object implements PacketWriter
Class to write a byte stream delimited by a byte marking the end of a packet.
Author:
Christoffer Lerno
  • Constructor Details

    • DelimiterPacketWriter

      public DelimiterPacketWriter(byte endByte)
  • Method Details

    • 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.