@Override
    public <T> byte[] serialize(T res, Class<T> clazz) throws CodecException {
        Preconditions.checkNotNull(codec, "Codec not init");
        try {
            return codec.encode(clazz, res);
        } catch (Exception e) {
            LOG.error("Serialize object failed", e);
            throw new CodecException("Serialize object error");
        }
    }
@ Override public < T > byte [ ] serialize ( T res , Class < T > clazz ) throws CodecException { Preconditions . checkNotNull ( codec , "Codec not init" ) ; try { return codec . encode ( clazz , res ) ; } catch ( Exception e ) { LOG . error ( "Serialize object failed" , e ) ; throw new CodecException ( "Serialize object error" ) ; } }
@see com.baidu.beidou.navi.protocol.SerializeHandler#serialize(java.lang.Object, java.lang.Class)