diff options
Diffstat (limited to 'src/main/java/bjc/everge/MirrorOutputStream.java')
| -rw-r--r-- | src/main/java/bjc/everge/MirrorOutputStream.java | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/main/java/bjc/everge/MirrorOutputStream.java b/src/main/java/bjc/everge/MirrorOutputStream.java deleted file mode 100644 index bce4f0f..0000000 --- a/src/main/java/bjc/everge/MirrorOutputStream.java +++ /dev/null @@ -1,63 +0,0 @@ -package bjc.everge; - -import java.io.*; -import java.util.*; - -/** - * An output stream that mirrors its contents to other streams. - * - * @author Ben Culkin - * - */ -public class MirrorOutputStream extends OutputStream { - private List<OutputStream> streams; - - /** - * Create a new mirroring output stream. - * - * @param strams - * The output streams to mirror to. - */ - public MirrorOutputStream(OutputStream... strams) { - streams = new ArrayList<>(); - - for (OutputStream stram : strams) { - streams.add(stram); - } - } - - @Override - public void close() throws IOException { - for (OutputStream stream : streams) { - stream.close(); - } - } - - @Override - public void flush() throws IOException { - for (OutputStream stream : streams) { - stream.flush(); - } - } - - @Override - public void write(byte[] ba) throws IOException { - for (OutputStream stream : streams) { - stream.write(ba); - } - } - - @Override - public void write(byte[] ba, int off, int len) throws IOException { - for (OutputStream stream : streams) { - stream.write(ba, off, len); - } - } - - @Override - public void write(int b) throws IOException { - for (OutputStream stream : streams) { - stream.write(b); - } - } -} |
