static byte[] getMD5Checksum(FSDataInputStream fsInputStream) throws Exception {
    byte[] buffer = new byte[1024];
    MessageDigest md5Digest = MessageDigest.getInstance("MD5");
    int numRead = 0;
    while (numRead != -1) {
      numRead = fsInputStream.read(buffer);
      if (numRead > 0) {
        md5Digest.update(buffer, 0, numRead);
      }
    }
    fsInputStream.close();
    return md5Digest.digest();
  }
Calculate MD5 checksum from data in FSDataInputStream
@param fsInputStream
@return byte array with md5 checksum bytes
@throws Exception
shims/common/src/main/java/org/apache/hadoop/fs/ProxyLocalFileSystem.java