inserting text into an existing file via java using -'java,file,file-io,filesystems'

inserting text into an existing file via java  using -'java,file,file-io,filesystems'

I would like to create a simple program (in Java) which edits text files - particularly one which performs inserting arbitrary pieces of text at random positions in a text file. This feature is part of a larger program I am currently writing.

Reading the description about java.util.RandomAccessFile, it appears that any write operations performed in the middle of a file would actually overwrite the exiting content.   This is a side-effect which I would like to avoid (if possible).

Is there a simple way to achieve this?

Thanks in advance.

asked Sep 7, 2015 by rajesh
0 votes

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.