Yes Yes I know about FileWriter(File, boolen append), It is not a problem to append on the end of the file,
1- But how to append into the middle of it ?
for example a text file includes 7 chars 1235678, I want to append just after 3 the char 4, what I should do
Do I have to read the file until I find '3' then I write to a temp file, append to its end , and continue reading what after '3' then append again to the end of the temp file, then create a new file with the same name to overwrite the old original one, read the tem file, write all data to that file,
even with the use of BufferReader/Writer, it is painfull and unefficient, in case I am right,
2-do you know why sun did that, I don't think they miss it out.
INSERTING something in the middle of a file has nothing to do with APPENDING.
Depending on the size of th file you could copy the whole content into a new file making the modifications, then delete the old file and rename the new file. This could cause of course problems with disc space. So you could also append let's say a empty string to the file, then shift the filecontent beginning at the end until you reach the point where you want to insert the new content.