Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. FileOutputStream f = new FileOutputStream("file.txt");
  2. System.setOut(new PrintStream(f));
  3.  
  4. final PrintStream oldStdout = System.out;
  5. System.setOut(newStdout);
  6. // ...
  7. System.setOut(oldStdout);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement