code: public static String digestMD5(InputStream inputStream) {
          int size = 4096;
          int readLen = 32;
          StringBuilder md5String = new StringBuilder();
          try {
              byte[] buffer = new byte[size];
              MessageDigest md5 = MessageDigest.getInstance("MD5");
              int len;
              while ((len = inputStream.read(buffer, 0, size)) != -1) {
                  md5.update(buffer, 0, len);
              }
              BigInteger bigInteger = new BigInteger(1, md5.digest());
              md5String.append(bigInteger.toString(16));
              if (md5String.length() < readLen) {
                  int j = readLen - md5String.length();
                  for (int i = 0; i < j; i++) {
                      md5String.insert(0, "0");
                  }
              }
          } catch (NoSuchAlgorithmException | IOException e) {
              throw new IllegalArgumentException(e);
          }
          return md5String.toString();
      }
docs: 文件流求MD5
  
  @param inputStream 文件流
  @return MD5