inserting data in the middle of a text file through java

前端 未结 2 496
礼貌的吻别
礼貌的吻别 2020-12-19 19:49

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

2条回答
  •  囚心锁ツ
    2020-12-19 20:15

    You have to read your file and rewrite it. During this operation you have to find the place where you want to put your text and write it.

提交回复
热议问题