Interface Deserializer<U extends IPacket>

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Deserializer<U extends IPacket>
    Function to deserialize a packet from a byte-based input stream.
    • Method Detail

      • deserialize

        U deserialize​(byte[] data,
                      int offset,
                      int length)
               throws DeserializationException
        Deserialize a packet object from a byte array.
        Parameters:
        data - input array to take packet bytes from
        offset - index where this packet header begins in the byte array
        length - length of the packet header
        Returns:
        a deserialized packet object
        Throws:
        DeserializationException - if the packet cannot be deserialized from the input