文章详情页
java读取本地png图片到byte数组?
问题描述
File file = new File(path);FileInputStream fis = new FileInputStream(file);byte[] img_content = new byte[(int) file.length()];fis.read(img_content);fis.close();
图片是存在的读入的内容全是0 是什么情况???
问题解答
回答1:文件损坏 和代码没有关系。。。。
标签:
java
相关文章:
1. javascript - html5显示隐藏2. angular.js - angularjs ng-repeat 不能刷新3. 关于《Effective Java中文版(第2版)》的问题4. css3的transform问题5. Angular.js 无法设置Authorization头,该怎么解决?6. 如何解决Centos下Docker服务启动无响应,且输入docker命令无响应?7. css - 移动端 oppo 手机之 Border-radius8. mysql 创建root 用户出错,这是什么原因?mysql 中也没有root用户9. javascript - 关于圣杯布局的一点疑惑10. css3 - 微信小程序如何把radio改成2个选择按钮的样式
排行榜