import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
public class MainClass {
public static void main(String[] args) throws IOException {
RandomAccessFile raf = new RandomAccessFile(new File("temp.tmp"), "rw");
raf.writeInt(1);
for (int i = 0; i < 10; i++) {
raf.seek(raf.length() - 4);
raf.writeInt(raf.readInt());
}
raf.close();
}
}
|