Click to See Complete Forum and Search --> : Does Anyone have the slightest idea on how to reset System.out?


jderman
October 9th, 2000, 03:49 PM
I have temporarily channeled the System.out.println using System.setOut:

biteMe = new ByteArrayOutputStream();
System.setOut(new PrintStream(biteMe,true));

But... now I want to set it back to default (screen window) etc.

Any clues??? Help Greatly Appreciated... No previous info found through search & Thanks inAdv

Phill
October 10th, 2000, 03:52 AM
Hi there
Before you use setOut, you can create
a reference to dos's output ie :

// Note you must do this before you change System.out so that you can get this reference
OutputStream outs = System.out;
PrintStream dos = new PrintStream(outs);



Then later when you want to print back in dos
you can do this:

System.setOut(dos);



Good luck
Phill.