总结:流类无法理解啊——————
package com.aini; import java.io.*; //流类 //使用FileInputStream读取文件信息 public class ffg {// 这个byte真的是个字节方法。。。一个不能错 public static byte[] readFileByFileInputStream(File file) throws IOException { ByteArrayOutputStream oot = new ByteArrayOutputStream(); FileInputStream fis = null; try { fis = new FileInputStream(file); byte[] b = new byte[4]; int i = 0;// 这个?? while ((i = fis.read(b, 0, b.length)) != -1) { oot.write(b, 0, i);// 缓冲区写入数据 } } catch (Exception E) { System.out.println("Error occurs during reading" + file.getAbsoluteFile()); } finally { if (fis != null) fis.close(); if (oot != null) oot.close(); } return oot.toByteArray(); } }