Java: How to add static text to file using ObjectOutputStream
<p>i am developing a small application in Java. At certain point i need to save the object of my custom class to a text file for this i override <code>toString()</code> method in my custom class and then use <code>ObjectOutputStream</code> class to save object of my custom class to text file. Now everything works fine i.e the text file contains the text as expected. Following three lines contain major code for that</p>

<pre><code>ObjectOutputStream outputStream = null;
outputStream = new ObjectOutputStream(new FileOutputStream(filename));
outputStream.writeObject(person);//person is the instance of my custom class
</code></pre>

<p>Now, how do i add some static data to my file along with the object data</p>

<pre><code>outputStream = new ObjectOutputStream(new FileOutputStream(filename));
outputStream.WhatFunctoinToUse("some static text");//What function i use to add static text??
outputStream.writeObject(person);//person is the instance of my custom class
</code></pre>
