Use java to modify file contents in place

后端 未结 3 533
北海茫月
北海茫月 2020-12-21 02:22

I need to modify specific contents of a file in-place.
I do not want to create a new file and rewrite the old. Also the files are small

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-21 02:58

    Java supports random file access, in particular using seek().

    Have a look at: http://docs.oracle.com/javase/tutorial/essential/io/rafs.html

提交回复
热议问题