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

com.firefly.net.tcp.codec.flex.decode.DefaultMetaInfoParser Maven / Gradle / Ivy

There is a newer version: 5.0.0-dev6
Show newest version
package com.firefly.net.tcp.codec.flex.decode;

import com.firefly.net.dataformats.Mapper;
import com.firefly.net.tcp.codec.flex.model.MetaInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

/**
 * @author Pengtao Qiu
 */
public class DefaultMetaInfoParser implements MetaInfoParser {

    private static final Logger log = LoggerFactory.getLogger("firefly-system");

    @Override
    public  T parse(byte[] data, Class clazz) {
        try {
            return Mapper.getMessagePackMapper().readValue(data, clazz);
        } catch (IOException e) {
            log.error("parse msg pack error", e);
            return null;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy