public static boolean compareStreams(@NotNull ThrowableComputable<? extends InputStream, ? extends IOException> stream1,
                                       @NotNull ThrowableComputable<? extends InputStream, ? extends IOException> stream2)
    throws IOException {
    int i = 0;
    try (InputStream s1 = stream1.compute()) {
      try (InputStream s2 = stream2.compute()) {
        if (s1 == null && s2 == null) return true;
        if (s1 == null || s2 == null) return false;

        while (true) {
          int b1 = s1.read();
          int b2 = s2.read();
          if (b1 != b2) return false;
          if (b1 == -1) return true;

          if (i++ % 10000 == 0) ProgressManager.checkCanceled();
        }
      }
    }
  }
public static boolean compareStreams(@NotNull ThrowableComputable<? extends InputStream, ? extends IOException> stream1,
                                       @NotNull ThrowableComputable<? extends InputStream, ? extends IOException> stream2)