docs: public static byte[] getHash( String digestName,
                                    InputStream stream ) throws NoSuchAlgorithmException, IOException {
          CheckArg.isNotNull(stream, "stream");
          MessageDigest digest = MessageDigest.getInstance(digestName);
          assert digest != null;
          int bufSize = 1024;
          byte[] buffer = new byte[bufSize];
          int n = stream.read(buffer, 0, bufSize);
          while (n != -1) {
              digest.update(buffer, 0, n);
              n = stream.read(buffer, 0, bufSize);
          }
          return digest.digest();
      }