您的位置:首页技术文章
文章详情页

java读取本地png图片到byte数组?

【字号: 日期:2024-01-01 14:05:50浏览:59作者:猪猪

问题描述

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
相关文章: