Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java write data to file without erasing the old content

Tags:

java

how can i write data to file without erasing the old content

like image 529
yonatan Avatar asked Sep 01 '26 15:09

yonatan


1 Answers

Use new FileOutputStream(file, true). This will open file in "append" mode which will append all data written to the stream to the end of that file.

like image 74
rodion Avatar answered Sep 03 '26 04:09

rodion