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

com.jarvis.cache.serializer.ISerializer Maven / Gradle / Ivy

There is a newer version: 7.2.1
Show newest version
package com.jarvis.cache.serializer;

import com.jarvis.cache.clone.ICloner;

import java.lang.reflect.Type;

/**
 *
 */
public interface ISerializer extends ICloner {

    /**
     * Serialize the given object to binary data.
     *
     * @param obj object to serialize
     * @return the equivalent binary data
     * @throws Exception 异常
     */
    byte[] serialize(final T obj) throws Exception;

    /**
     * Deserialize an object from the given binary data.
     *
     * @param bytes      object binary representation
     * @param returnType the GenericReturnType of AOP Method
     * @return the equivalent object instance, 必须是CacheWrapper类型的
     * @throws Exception 异常
     */
    T deserialize(final byte[] bytes, final Type returnType) throws Exception;

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy