return an object using ObjectOutputStream
<p>I found a segment of java code that is claimed to return object using ObjectOutputStream</p>

<pre><code>     OutputStream outstr = response.getOutputStream();
     ObjectOutputStream oos = new ObjectOutputStream(outstr);

     oos.writeObject(process);

     oos.flush();
     oos.close();
</code></pre>

<p>response is a HttpServletResponse object. I would like to know how this segment of code works, and how to test it?</p>
