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

com.jn.agileway.codec.serialization.xson.XsonCodec Maven / Gradle / Ivy

package com.jn.agileway.codec.serialization.xson;

import com.jn.agileway.codec.AbstractCodec;
import com.jn.langx.codec.CodecException;

public class XsonCodec extends AbstractCodec {

    @Override
    protected byte[] doEncode(T t, boolean withSchema) throws CodecException {
        try {
            return Xsons.serialize(t);
        } catch (Throwable ex) {
            throw new CodecException(ex.getMessage(), ex);
        }
    }

    @Override
    protected T doDecode(byte[] bytes, boolean withSchema, Class targetType) throws CodecException {
        return Xsons.deserialize(bytes, targetType);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy