append text to the end of the file

前端 未结 1 1588
太阳男子
太阳男子 2020-12-20 18:21

I am using the below code segment to write text to the end o the file for each time it is called. But, it is erasing the old data and then writes the new data to the beginni

1条回答
  •  囚心锁ツ
    2020-12-20 19:00

    Try to set append boolean value to true in FileOutputStream:

    outStream = new FileOutputStream(out, true);
    outStreamWriter = new OutputStreamWriter(outStream); 
    

    0 讨论(0)
提交回复
热议问题