【发布时间】:2017-04-23 14:06:04
【问题描述】:
我认为它用 randomAccessFile 写入的顺序与它读取的顺序不匹配。我该如何纠正?跟大/小端有关系吗?
RandomAccessFile accessor = new RandomAccessFile (new File("passwd_file"), "rws");
accessor.write(macbytes);
//System.out.println(macbytes);
byte[] test=new byte[(int) accessor.length()];
accessor.seek(0);
accessor.read(test);
//System.out.println(test);
if (test.equals(macbytes))System.out.println("true");
else System.out.println("false");
【问题讨论】:
标签: java randomaccessfile