I am try to write data to a text file. I am using this code:
try (Writer writer = new BufferedWriter(new OutputStreamWriter(
new FileOutputStream("filename.txt"), "utf-8"))) {
writer.write("something");
}
But while the program is running, the file is overwriting the exist data that are already found in the text file. How can i write new data lines to the same text file without overwriting it ? Is there any easy and simple way to write it?