1

Let's say I have a file called foo.txt with the data

 - "this is a sentence"

Looking at it with defragmentation tools, I can see 1 extent.

What I want to do is insert something in it without having to rewrite the data, so it would look like this :

 - "this is a"
 - "modified"
 - "sentence"

With 3 extents, does Java supports that ?

lleclerc
  • 653
  • 5
  • 10
  • I guess open file in append mode and look at insert :http://stackoverflow.com/questions/5884353/insert-a-character-in-a-string-at-a-certain-position – Suresh Atta Oct 19 '13 at 13:05
  • I don't want to insert string in memory, but in hard-drive. I don't want to read the whole file or re-write it. – lleclerc Oct 19 '13 at 13:08

0 Answers0