docs: public static byte[] getHash( String digestName,
                                    File file ) throws NoSuchAlgorithmException, IOException {
          CheckArg.isNotNull(file, "file");
          MessageDigest digest = MessageDigest.getInstance(digestName);
          assert digest != null;
          InputStream in = new BufferedInputStream(new FileInputStream(file));
          boolean error = false;
          try {
              int bufSize = 1024;
              byte[] buffer = new byte[bufSize];
              int n = in.read(buffer, 0, bufSize);
              while (n != -1) {
                  digest.update(buffer, 0, n);
                  n = in.read(buffer, 0, bufSize);
              }
          } catch (IOException e) {
              error = true;
              throw e;
          } finally {
              try {
                  in.close();
              } catch (IOException e) {
                  if (!error) throw e;
              }
          }
          return digest.digest();
      }