package com.hmsoft.remote.rmi.common.serialize.support.hessian;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import com.hmsoft.remote.rmi.common.serialize.ObjectInput;
import com.hmsoft.remote.rmi.common.serialize.ObjectOutput;
import com.hmsoft.remote.rmi.common.serialize.Serialization;

/**
 * @author ding.lid
 */
public class Hessian2Serialization implements Serialization {
    
    public static final byte ID = 2;

    public byte getContentTypeId() {
        return ID;
    }

    public String getContentType() {
        return "x-application/hessian2";
    }

    public ObjectOutput serialize(String url, OutputStream out) throws IOException {
        return new Hessian2ObjectOutput(out);
    }

    public ObjectInput deserialize(String url, InputStream is) throws IOException {
        return new Hessian2ObjectInput(is);
    }

}