- Joined
- Oct 31, 2007
- Messages
- 3
- Reaction score
- 0
I have a server which is always sending data, and I want to keep sending this data to a file. I tried using the following:
try{
file= FileOutputStream("modem.txt");
new PrintStream(file).println(new String(in));
file.close();
}
catch (IOException e){System.err.println("error");
System.exit(-1);}
But my data is always been overwritten, I want to keep the old and new data.
Is there any way to keep sending data into a file without overriding the old data?
try{
file= FileOutputStream("modem.txt");
new PrintStream(file).println(new String(in));
file.close();
}
catch (IOException e){System.err.println("error");
System.exit(-1);}
But my data is always been overwritten, I want to keep the old and new data.
Is there any way to keep sending data into a file without overriding the old data?