//读取文件到byte[]
private static byte[] getFileBytes(String file) {
try {
File f = new File(file);
int length = (int) f.length();
byte[] data = new byte[length];
new FileInputStream(f).read(data);
return data;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
java读取文件到byte[]
猜你喜欢
转载自blog.csdn.net/lemisky/article/details/99329625
今日推荐
周排行