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

com.jarvis.cache.serializer.kryo.KryoContext Maven / Gradle / Ivy

package com.jarvis.cache.serializer.kryo;

/**
 * kryo接口
 *
 * @author stevie.wong
 */
public interface KryoContext {
    /**
     * 序列化
     *
     * @param obj 对象
     * @return byte[]
     */
    byte[] serialize(Object obj);

    /**
     * 序列化
     *
     * @param obj        对象
     * @param bufferSize 缓冲大小
     * @return byte[]
     */
    byte[] serialize(Object obj, int bufferSize);

    /**
     * 反序列化
     *
     * @param serialized byte[]
     * @return 对象
     */
    Object deserialize(byte[] serialized);

    /**
     * 添加Kryo类注册器
     * @param registration see {@link KryoClassRegistration}
     */
    void addKryoClassRegistration(KryoClassRegistration registration);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy