How to extract content that is sent to a PrintStream?
<p>Im using a thirdparty class that has the following method:</p>

<pre><code>public void print(PrintStream s);
</code></pre>

<p>But what I want to do is acually log the output. SOmething like:</p>

<pre><code>RecordingPrintStream p = new RecordingPrintStream
instance.print(p);
logger.log(p.getContents());
</code></pre>

<p>So what can I use as my RecordingPrintStream?</p>
