我正在尝试将数字(字节)列表存储到文件中,以便可以将它们检索到字节 [] 中。
59 20 60 21 61 22 62 23 63 24 64 25 65 26 66 27 67 28 68 29
67 30 66 31 65 32 64 33 63 34 62 35 61 36 60 37 59 38
66 29 65 30 64 31 63 32 62 33 61 34 60 35 59 36 58 37
65 28 64 29 63 30 62 31 61 32 60 33 59 34 58 35 57 36...
我尝试将它们保存到文本文件中,但相关代码似乎无法正确读取。
try {
File f = new File("cube_mapping2.txt");
array = new byte[file.size()]
FileInputStream stream = new FileInputStream(f);
stream.read(array);
} catch (Exception e) {
e.printStackTrace();
}
是否有正确的方法来保存文件,以便FileInputReader.read(byte[] buffer)
用我的字节填充数组?