1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-05 00:45:06 -05:00
filebot/source/net/sourceforge/tuned/TeePrintStream.java
2013-03-26 15:04:53 +00:00

57 lines
892 B
Java

package net.sourceforge.tuned;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
public class TeePrintStream extends PrintStream {
private final PrintStream cc;
public TeePrintStream(OutputStream out, boolean autoFlush, String encoding, PrintStream cc) throws UnsupportedEncodingException {
super(out, autoFlush, encoding);
this.cc = cc;
}
@Override
public void close() {
super.close();
cc.close();
}
@Override
public void flush() {
super.flush();
cc.flush();
}
@Override
public void write(byte[] buf, int off, int len) {
super.write(buf, off, len);
cc.write(buf, off, len);
}
@Override
public void write(int b) {
super.write(b);
cc.write(b);
}
@Override
public void write(byte[] b) throws IOException {
super.write(b);
cc.write(b);
}
}