Jump to Real's How-to Main page

Redirect stdout to a file

[JDK1.1] application only
System.setOut(
    new PrintStream(
      new BufferedOutputStream(
       new FileOutputStream("OUTPUT.DAT")))); 

You may want to look at this How-to to redirect exception output to a Frame.


If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]