I want to write data (int) into a files, but I don't want to erase the file's contents. I mean, I want to fill the data I get into a file. How do I do that? So far in my code, the current data always overwrite the last data.
Thanks in advance.
posted 10 years ago
There's a boolean parameter in the FileOutputStream class's constructor, which tells the output stream whether it should write the bytes at the beginning or at the end of the file. Set it to true in order to append the data to the existing data.