Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FileOutputStream f = new FileOutputStream("file.txt");
- System.setOut(new PrintStream(f));
- final PrintStream oldStdout = System.out;
- System.setOut(newStdout);
- // ...
- System.setOut(oldStdout);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement