How can I open the same file for reading as well as writing?

John Zukowski

The RandomAccessFile class supports simultanous reading and writing from the same file. Just open it in "rw" mode:

RandomAccessFile raf = 
    new RandomAccessFile("filename.txt", "rw");
Use skipBytes() to move to where you wish to read/write.
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.