java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
edu.vt.middleware.crypt.io.TeePrintStream
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
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
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorsConstructorDescriptionTeePrintStream
(OutputStream out1, OutputStream out2) Creates a tee stream that writes to both of the given streams simultaneously. -
Method Summary
Methods inherited from class java.io.PrintStream
append, append, append, checkError, clearError, close, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, writeBytes
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
TeePrintStream
Creates a tee stream that writes to both of the given streams simultaneously. To operate like the Unixtee
, the second stream should be STDOUT or STDERR.- Parameters:
out1
- Primary output stream.out2
- Secondary output stream, usuallySystem.out
orSystem.err
.
-
-
Method Details
-
write
public void write(int b) - Overrides:
write
in classPrintStream
-
write
public void write(byte[] buf, int off, int len) - Overrides:
write
in classPrintStream
-
flush
public void flush()- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classPrintStream
-