字节数组

FileInputStream fis = new FileInputStream ("test.txt");//创建读取管道

byte[] arr = new byte[2];  //创建字节数组

int a = fis.read(arr); //将文件上的字节读取到字节数组中(a为读取到的有效字节个数)

for(byte b : arr){  //遍历字节数组

syso(b);

}

 

fis.close();

原文地址:https://www.cnblogs.com/wangffeng293/p/13040319.html