com.codingapi.tx.framework.utils.SerializerUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tx-client Show documentation
Show all versions of tx-client Show documentation
tx-client project for Spring Boot
package com.codingapi.tx.framework.utils;
import com.lorne.core.framework.exception.SerializerException;
import com.codingapi.tx.model.TransactionInvocation;
import com.codingapi.tx.framework.utils.serializer.ISerializer;
import com.codingapi.tx.framework.utils.serializer.ProtostuffSerializer;
/**
* create by lorne on 2017/8/3
*/
public class SerializerUtils {
private static ISerializer serializer = new ProtostuffSerializer();
public static byte[] serializeTransactionInvocation(TransactionInvocation invocation) {
try {
return serializer.serialize(invocation);
} catch (SerializerException e) {
e.printStackTrace();
return null;
}
}
public static TransactionInvocation parserTransactionInvocation(byte[] value) {
try {
return serializer.deSerialize(value, TransactionInvocation.class);
} catch (SerializerException e) {
e.printStackTrace();
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy