Use ObjectOutputStream and FileOutputStream with FileWriter
- by wishi
Hi!
Is there any way to use ObjectOutputStream like this:
<tag>output of the ObjectOutputStream</tag>
If I try:
FileOutputStream fos = new FileOutputStream(filename);
ObjectOutputStream oos = new ObjectOutputStream(fos);
FileWriter fw = new FileWriter(fos);
And for example:
fw.write("<tag>");
oos.write(cool_object);
fw.wrote("</tag>");
I don't get that result. It seems the ObjectOutputStream overwrites the file completly each and every time.