All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.mais_h.mathsync.serialize.Serializer Maven / Gradle / Ivy

package eu.mais_h.mathsync.serialize;

/**
 * Serializes objects to arrays of bytes.
 *
 * @param  the type of input objects.
 */
public interface Serializer {

  /**
   * Serializes an object to an array of byte.
   *
   * 

Any instance of T must be accepted and have a non null return value: * for any o, o instanceof T implies serialize(o) != null.

* *

The output must be consistent, an identical output should be returned if called twice on the equal * objects: for any o1 and o2, o1.equals(o2) implies * Arrays.equals(serialize(o1), serialize(o2)).

* * @param item the object to serialize. * @return the array of bytes representing the input object on the wire. */ byte[] serialize(T item); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy