From 4d449a9b96570e8c655fc303ca0ca81dab394e3d Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Wed, 20 May 2020 19:40:06 -0400 Subject: Update docs --- .../bjc.everge/MirrorOutputStream.java.html | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 docs/jacoco-ut/bjc.everge/MirrorOutputStream.java.html (limited to 'docs/jacoco-ut/bjc.everge/MirrorOutputStream.java.html') diff --git a/docs/jacoco-ut/bjc.everge/MirrorOutputStream.java.html b/docs/jacoco-ut/bjc.everge/MirrorOutputStream.java.html new file mode 100644 index 0000000..51175e0 --- /dev/null +++ b/docs/jacoco-ut/bjc.everge/MirrorOutputStream.java.html @@ -0,0 +1,64 @@ +MirrorOutputStream.java

MirrorOutputStream.java

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);
+		}
+	}
+}
+
\ No newline at end of file -- cgit v1.2.3