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

com.shijingsh.core.codec.ContentCodec Maven / Gradle / Ivy

The newest version!
package com.shijingsh.core.codec;

import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Type;

/**
 * 消息内容编解码器
 *
 * @author Birdy
 */
public interface ContentCodec {

    /**
     * 解码内容
     *
     * @param type
     * @param content
     * @return
     */
    Object decode(Type type, byte[] content);

    /**
     * 解码内容
     *
     * @param type
     * @param stream
     * @return
     */
    Object decode(Type type, InputStream stream);

    /**
     * 编码内容
     *
     * @param type
     * @param content
     * @return
     */
    byte[] encode(Type type, Object content);

    /**
     * 编码内容
     *
     * @param type
     * @param content
     * @param stream
     */
    void encode(Type type, Object content, OutputStream stream);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy