Interface ISerializer<T>

Type Parameters:
T - The type of the object which this class serializes
All Known Implementing Classes:
AccrualMessageSerializer, AckosMessageSerializer, BabelMessageSerializer

public interface ISerializer<T>
Represents a serializer/deserializer that writes/reads objects to/from a byte buffer
Author:
pfouto
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(io.netty.buffer.ByteBuf in)
    Deserializes an object from a byte buffer and returns it.
    void
    serialize(T t, io.netty.buffer.ByteBuf out)
    Serializes the received object into the received byte buffer.
  • Method Details

    • serialize

      void serialize(T t, io.netty.buffer.ByteBuf out) throws IOException
      Serializes the received object into the received byte buffer.
      Parameters:
      t - The object to serialize
      out - The byte buffer to which the object will the written
      Throws:
      IOException - if the serialization fails
    • deserialize

      T deserialize(io.netty.buffer.ByteBuf in) throws IOException
      Deserializes an object from a byte buffer and returns it.
      Parameters:
      in - The byte buffer which contains the object to be deserialized
      Returns:
      The deserialized object
      Throws:
      IOException - if the deserialization fails