Package naga

Interface PacketReader

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static byte[] SKIP_PACKET  
    • Field Detail

      • SKIP_PACKET

        static final byte[] SKIP_PACKET
    • Method Detail

      • nextPacket

        byte[] nextPacket​(java.nio.ByteBuffer byteBuffer)
                   throws ProtocolViolationException
        Create a new packet using the ByteBuffer given.

        If there isn't sufficient data to construct a packet, return null.

        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.