title: How to write multiple objects to file?
body: <p>I want to write multiple objects to a file, but the problem is that I dont have all the objects to write at once. I have to write one object and then close the file, and then maybe after sometime I want to add another object to the same file.</p>
  
  <p>I am currently doing it as
   <code>FileOutputStream("filename", true)</code> 
  so that it will append the object to the end of file and not overwrite it. But I get this error :</p>
  
  <blockquote>
    <p>java.io.StreamCorruptedException: invalid type code: AC</p>
  </blockquote>
  
  <p>any ideas how can I solve this issue ?</p>
  
  <p>Thanks,</p>