Setting and resetting stdout
Hi,
I'd like to temporarily redirect IO fron within java code. The redirecting part is easy enough using System.setOut(printStream) but the lack of a corresponding System.getOut( ) is keeping me from restoring the old value. In other words, I want to do this:
PrintStream newOut = ...
PrintStream oldOut = System.getOut( );
System.setOut(newOut);
// Write a bunch of stuff to the new stdout
// Restore the old value
System.setOut(oldOut);
but of course, can't, becasue there is no System.getOut( ). I'm sure there is a simple solutin here, but I'm not seeing it. Can anyone point me in the right direction? Thanks in advance.
-exits

