代码:
RandomAccessFile raf = new RandomAccessFile("ran.txt", "rw");
raf.write("张三".getBytes());
raf.writeInt(97);
byte[] b=new byte[4];
raf.read(b);
String nameString=new String(b);
System.out.println(nameString);
int age=raf.readInt();
System.out.println(age);
raf.close();
错误:EOF错误
老是粘贴不了错误
|
|