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



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!