I've an app that is writing data to a file. The first time I run it, it goes grand and writes 1000s of values to the file. Then I close the app using this code
finish();
System.exit(0);
Which happens when I hit the stop button.
When I run it again after stopping, say in a few minutes, it only writes a few values to a new file, over the same time frame.
Here is the code I use to write to the file:
public void write(String message) {
try {
if (out == null) {
FileWriter datawriter = new FileWriter(file, true);
out = new BufferedWriter(datawriter);
//out.write("X Value, Y Value, Z Value \n");
}
if (file.exists()) {
out.append(message);
out.flush();
}
Any insight into why this is happening would be much appreciated.
Thanks