如何在Java中读取文件字节?

如何从文件中读取一个字节,并将其放入字节数组而不将字节转换为整数?

FileInputStream fis = new FileInputStream("your file name"); byte[] bytes = new byte[100]; // replace 100 with the desired size, of course int offset = 0; // which element to stuff the byte into fis.read(bytes, offset, 1); // the 1 is how many bytes to read 
  byte ch; try { is = new DataInputStream(new FileInputStream("fileName.dat")); while (true) { ch = is.readByte(); // put here in any byte array ... System.out.flush(); } }