字节数组

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();

posted @ 2020-06-03 21:58  一块  阅读(845)  评论(0编辑  收藏  举报