Class TeePrintStream

All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class TeePrintStream extends PrintStream
Works like the Unix tee utility by writing to two streams simultaneously, where one is typically STDOUT or STDERR.
Version:
$Revision: 2745 $
Author:
Middleware Services
  • Constructor Details

    • TeePrintStream

      public TeePrintStream(OutputStream out1, OutputStream out2)
      Creates a tee stream that writes to both of the given streams simultaneously. To operate like the Unix tee, the second stream should be STDOUT or STDERR.
      Parameters:
      out1 - Primary output stream.
      out2 - Secondary output stream, usually System.out or System.err.
  • Method Details