|
-
October 9th, 2000, 03:49 PM
#1
Does Anyone have the slightest idea on how to reset System.out?
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
-
October 10th, 2000, 03:52 AM
#2
Re: Does Anyone have the slightest idea on how to reset System.out?
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|