Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
The stream redirection demo application shows the various steps you can take to redirect all three of the standard streams to or from regular files using Java 1.1.
The java.lang.System API was changed in Java 1.1 such that the in, out, and err streams are now final. Luckily, the API was also extended to include methods to change those streams:
As before, the application presumes that a file called Redirect.in exists. It reads that file in place of the System.in standard input stream and prints it to the original System.out standard output stream. The application will redirect the System.out output stream and the System.err standard error stream to the Redirect.out and Redirect.err files, respectively.
Note that you will get warnings when compiling
Redirect.java. These warnings are generated in Java 1.1 since the use of the
PrintStream constructors have been deprecated.
PrintStream has mostly been superseded by the
PrintWriter class, but
PrintStream is still used for the System.in and System.out streams. So, just ignore those deprecation warnings for this particular use
Thanks to Jeff Rhyason for prompting us for this update.