@Test(expected = MismatchException.class) public void testWrite_WholeBuffer_Fail() throws IOException { byte[] tweaked = new byte[] {0, 1, 2, 3, 4, 55, 6, 7, 8, 9}; outputStream.write(tweaked); }
@Override public void write(int b) throws IOException { int expected = expectedBytesStream.read(); if (expected == -1) { throw new MismatchException("EOF reached in expectedBytesStream"); } if (expected != b) { throw new MismatchException("Data does not match"); } }
MatchingOutputStream extends OutputStream { @Override public void write(int b) throws IOException { int expected = expectedBytesStream.read(); if (expected == -1) { throw new MismatchException("EOF reached in expectedBytesStream"); } if (expected != b) { throw new MismatchException("Data does not match"); } } }
MatchingOutputStream extends OutputStream { @Override public void write(int b) throws IOException { int expected = expectedBytesStream.read(); if (expected == -1) { throw new MismatchException("EOF reached in expectedBytesStream"); } if (expected != b) { throw new MismatchException("Data does not match"); } } MatchingOutputStream(InputStream expectedBytesStream, int matchBufferSize); }
MatchingOutputStream extends OutputStream { @Override public void write(int b) throws IOException { int expected = expectedBytesStream.read(); if (expected == -1) { throw new MismatchException("EOF reached in expectedBytesStream"); } if (expected != b) { throw new MismatchException("Data does not match"); } } MatchingOutputStream(InputStream expectedBytesStream, int matchBufferSize); @Override void write(int b); @Override void write(byte[] b); @Override void write(byte[] dataToWrite, int offset, int length); void expectEof(); }
MatchingOutputStream extends OutputStream { @Override public void write(int b) throws IOException { int expected = expectedBytesStream.read(); if (expected == -1) { throw new MismatchException("EOF reached in expectedBytesStream"); } if (expected != b) { throw new MismatchException("Data does not match"); } } MatchingOutputStream(InputStream expectedBytesStream, int matchBufferSize); @Override void write(int b); @Override void write(byte[] b); @Override void write(byte[] dataToWrite, int offset, int length); void expectEof();  }