public static BinaryDiffResult noDiff() { return new BinaryDiffResult(EOF, 0, 0); }
public static BinaryDiffResult noDiff() { return new BinaryDiffResult(EOF, 0, 0); }
@VisibleForTesting public BinaryDiffResult diff(InputStream actualStream, InputStream expectedStream) throws IOException { int index = 0; while (true) { int actual = actualStream.read(); int expected = expectedStream.read(); if (actual == -1 && expected == -1) return BinaryDiffResult.noDiff(); // reached end of both streams if (actual != expected) return new BinaryDiffResult(index, expected, actual); index += 1; } } }
@VisibleForTesting public BinaryDiffResult diff(InputStream actualStream, InputStream expectedStream) throws IOException { int index = 0; while (true) { int actual = actualStream.read(); int expected = expectedStream.read(); if (actual == -1 && expected == -1) return BinaryDiffResult.noDiff(); // reached end of both streams if (actual != expected) return new BinaryDiffResult(index, expected, actual); index += 1; } } }
public static BinaryDiffResult noDiff() { return new BinaryDiffResult(EOF, 0, 0); }
@VisibleForTesting public BinaryDiffResult diff(InputStream actualStream, InputStream expectedStream) throws IOException { int index = 0; while (true) { int actual = actualStream.read(); int expected = expectedStream.read(); if (actual == -1 && expected == -1) return BinaryDiffResult.noDiff(); // reached end of both streams if (actual != expected) return new BinaryDiffResult(index, expected, actual); index += 1; } } }