class BinaryDiff {

  @VisibleForTesting
  public BinaryDiffResult diff(File actual, byte[] expected) throws IOException {
    return diff(actual.toPath(), expected);
  }

  @VisibleForTesting
  public BinaryDiffResult diff(Path actual, byte[] expected) throws IOException {
    try (InputStream actualStream = new BufferedInputStream(Files.newInputStream(actual))) {
      return diff(actualStream, expected);
    }
  }

  @VisibleForTesting
  public BinaryDiffResult diff(InputStream actualStream, byte[] expected) throws IOException {
    try (InputStream expectedStream = new ByteArrayInputStream(expected)) {
      return diff(actualStream, expectedStream);
    }
  }

  @VisibleForTesting
  public BinaryDiffResult diff(InputStream actualStream, InputStream expectedStream) throws IOException {<FILL_FUNCTION_BODY>}
}

    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;
    }
  
<no_super_class>