class HessianSerializer implements Serializer {

    private SerializerFactory                         serializerFactory    = new SerializerFactory();
    private static ThreadLocal<ByteArrayOutputStream> localOutputByteArray = new ThreadLocal<ByteArrayOutputStream>() {
                                                                               @Override
                                                                               protected ByteArrayOutputStream initialValue() {
                                                                                   return new ByteArrayOutputStream();
                                                                               }
                                                                           };

    /** 
     * @see com.alipay.remoting.serialization.Serializer#serialize(java.lang.Object)
     */
    @Override
    public byte[] serialize(Object obj) throws CodecException {<FILL_FUNCTION_BODY>}

    /**
     * 
     * @see com.alipay.remoting.serialization.Serializer#deserialize(byte[], java.lang.String)
     */
    @SuppressWarnings("unchecked")
    @Override
    public <T> T deserialize(byte[] data, String classOfT) throws CodecException {
        Hessian2Input input = new Hessian2Input(new ByteArrayInputStream(data));
        input.setSerializerFactory(serializerFactory);
        Object resultObject;
        try {
            resultObject = input.readObject();
            input.close();
        } catch (IOException e) {
            throw new CodecException("IOException occurred when Hessian serializer decode!", e);
        }
        return (T) resultObject;
    }

}

        ByteArrayOutputStream byteArray = localOutputByteArray.get();
        byteArray.reset();
        Hessian2Output output = new Hessian2Output(byteArray);
        output.setSerializerFactory(serializerFactory);
        try {
            output.writeObject(obj);
            output.close();
        } catch (IOException e) {
            throw new CodecException("IOException occurred when Hessian serializer encode!", e);
        }
        return byteArray.toByteArray();
    
<no_super_class>