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

相关文章:

  • 2021-12-06
  • 2022-01-22
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-10
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案