Interface Serializer<E>

Type Parameters:
E - the type of object that this serializer handles

public interface Serializer<E>
The Serializer interface defines the contract for serializing and deserializing objects to and from binary streams in the Ccerial framework.

Implementations of this interface are responsible for converting Java objects into a compact binary format and reconstructing objects from that format.

  • Method Summary

    Modifier and Type
    Method
    Description
    Deserializes data from the provided InputStream and reconstructs an instance of the object.
    void
    serialize(OutputStream out, E entity)
    Serializes the specified entity into a binary format and writes it to the provided OutputStream.
  • Method Details

    • serialize

      void serialize(OutputStream out, E entity) throws IOException
      Serializes the specified entity into a binary format and writes it to the provided OutputStream.
      Parameters:
      out - the OutputStream where the serialized data will be written
      entity - the entity to serialize
      Throws:
      IOException - if an I/O error occurs during serialization
    • deserialize

      E deserialize(InputStream in) throws IOException
      Deserializes data from the provided InputStream and reconstructs an instance of the object.
      Parameters:
      in - the InputStream containing the binary data to deserialize
      Returns:
      the reconstructed object of type E
      Throws:
      IOException - if an I/O error occurs during deserialization