obive.net

FileOutputStream truncates files when instantiated

Monday October 5, 2009 @ 7:42 PM EST

Who would have thought? Use a RandomAccessFile instead! =)

Notice to Sun (Oracle?): It would be cool if this were not only mentioned in the documentation but very clear, as it has potential for data loss, and in my case would have saved me a lot of time.