@@ -0,0 +1,655 @@
+package com.ajj.robodtn.test;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.OutputStream;%0A%0Apublic class ComparisonStream extends OutputStream %7B%0A%09public ComparisonStream(InputStream in) %7B%0A%09%09this.in = in;%0A%09%7D%0A%09%0A%09private InputStream in;%0A%09private int bytesWritten = 0;%0A%0A%09public void write(int oneByte) throws IOException %7B%0A%09%09int readByte = in.read();%0A%09%09if (readByte == -1) %7B%0A%09%09%09throw new IOException(%22Output Stream is longer than input stream%22);%0A%09%09%7D%0A%09%09if ((readByte & 0xFF) != (oneByte & 0xFF)) %7B%0A%09%09%09throw new IOException(%22Output stream has %22 + oneByte + %22 but in has %22 + readByte + %22 at %22 + bytesWritten);%0A%09%09%7D%0A%09%09bytesWritten++;%0A%09%7D%0A%7D%0A

Add ComparisonStream, a test class that throws an exception if streams don't match.