import java.io.IOException;
import java.io.RandomAccessFile;
public class RandomFileAccess {
public static void main(String[] args) throws IOException {
RandomAccessFile raf = new RandomAccessFile("d:/abc.txt", "rw");
// 你需要使用seek设置文件的偏移量
raf.seek(raf.length());
raf.writeChars("ajaxfan");
raf.close();
}
}