You can open the same file for reading as well as reading in Java using RandomAccessFile class. RandomAccessFile class supports simultanous reading and writing from/to the same file if you open the file in "rw" mode:

 RandomAccessFile raf = 
    new RandomAccessFile("filename.txt", "rw");