FileInterceptor.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:HDImageView 作者:
@Override
public BitmapRegionDecoder intercept(Chain chain) throws IOException {
    final Uri uri = chain.uri();
    BitmapRegionDecoder decoder = chain.chain(uri);
    if (decoder != null){
        return decoder;
    }


    if (UriUtil.isLocalFileUri(uri)){
        File file = new File(uri.getPath());
        if (BuildConfig.DEBUG) {
            Log.d("FileInterceptor", "从我这加载");
        }
        try {
            return BitmapRegionDecoder.newInstance(new FileInputStream(file.toString()),false);
        } catch (IOException e) {
            return Interceptors.fixJPEGDecoder(file,e);
        }
    }
    return null;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号