BitmapFactory.decodeStream(inputStream,null,options)返回为null
2016-12-18 19:36
471 查看
偶然发现BitmapFactory.decodeStream(inputStream,null,options)返回为null一头雾水,完全不知道怎么回事!然后发现BitmapFactory.decodeByteArray(bytes,0,bytes.length)是ok的;
7.0的系统还是空,原因是访问了sd卡外部的文件,应该把图片保存到getFilesDir()文件夹下,在decode出来的就ok了
public static byte[] toByteArray(InputStream input) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; int n = 0; while (-1 != (n = input.read(buffer))) { output.write(buffer, 0, n); } return output.toByteArray(); }
7.0的系统还是空,原因是访问了sd卡外部的文件,应该把图片保存到getFilesDir()文件夹下,在decode出来的就ok了
相关文章推荐
- BitmapFactory.decodeStream(inputStream)返回null的解决方法
- BitmapFactory.decodeFactory.decodeStream(InputStream xx)返回为null
- BitmapFactory.decodeStream方法返回null的错误分析
- BitmapFactory.decodeFile(filePath, options) 返回 Null 6.0权限
- 解决android BitmapFactory.decodeStream()返回null
- 安卓BitmapFactory.decodeStream()返回null的问题解决方法
- BitmapFactory.decodeStream()获取bitmap返回null
- Android异步从网络加载图片BitmapFactory.decodeStream 返回null的问题
- Android异步加载图片资源,BitmapFactory.decodeStream返回null的问题
- 安卓BitmapFactory.decodeStream()返回null的问题解决方法
- BitmapFactory.decodeStream方法返回null的错误分析
- Android BitmapFactory.decodeFile(filePath, options) 返回 Null 6.0权限
- BitmapFactory.decodeStream返回null
- BitmapFactory.decodeStream。报错:SkImageDecoder::Factory returned null 原因及解决方法
- Solution to BitmapFactory decodeStream null
- BitmapFactory.decodeByteArray() 返回null,分析与解决
- BitmapFactory.decodeResource()方法在版本26返回null问题
- Android 压缩网络上的图片BitmapFactory.decodeStream()返回为空的问题
- android获取网络图片的用法 BitmapFactory.decodeByteArray 返回null
- 调用 BitmapFactory.decodeByteArray 函数返回 null 值