【仅供内部供应商使用,不提供对外解答和培训】
【仅供内部供应商使用,不提供对外解答和培训】
从数据库读取的二进制类型数据,转换成Image时会调用该接口。
之前的情况是所有二进制类型的数据都会走一遍转换成Image的流程,现在将这个流程做成接口,来实现性能优化。
/** * 由byte[]到Image的转换接口 * * Created by loy on 2016/12/5. */ public interface ImageParserProcessor extends Immutable { String MARK_STRING = "ImageParserProcessor"; /** * 转换Image * @param b * @return 如果b[]非图片格式,返回null */ Image parseImage(byte[] b); }
<extra-core> <ImageParserProcessor class="com.fr.plugin.performance.imageparser.ImageParserImpl"/> </extra-core>