I want to insert the data at some positions in the text file without actually overwriting on the existing data.I tried RandomAccessFile ....but that also overwrites it....
I
It is not possible (not with Java, and not with any other programming language) to "just" insert data in the middle of the file, without having to re-write the rest of the file. The problem is not the programming language, the problem is the way files work.