com.github.ddth.commons.serialization.ISerDeser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ddth-commons-core Show documentation
Show all versions of ddth-commons-core Show documentation
DDTH's Java Common Libraries and Utilities
package com.github.ddth.commons.serialization;
/**
* Serializer/Deserializer interface.
*
* @author Thanh Nguyen
* @since 0.5.0
*/
public interface ISerDeser {
/**
* Serialize an object.
*
* @return
* @throws SerializationException
*/
public byte[] toBytes(Object obj) throws SerializationException;
/**
* Serialize an object.
*
* @param obj
* @param classLoader
* @return
* @throws SerializationException
*/
public byte[] toBytes(Object obj, ClassLoader classLoader) throws SerializationException;
/**
* Deserialize an object.
*
* @param data
* @param clazz
* @return
* @throws DeserializationException
*/
public T fromBytes(byte[] data, Class clazz) throws DeserializationException;
/**
* Deserialize an object.
*
* @param data
* @param clazz
* @param classLoader
* @return
* @throws DeserializationException
*/
public T fromBytes(byte[] data, Class clazz, ClassLoader classLoader)
throws DeserializationException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy