code: public static String getChecksum(DigestInputStream digestStream) {
          MessageDigest digest = digestStream.getMessageDigest();
          return checksumBytesToString(digest.digest());
      }
docs: Determines the checksum value of a DigestInputStream's underlying
  stream after the stream has been read.
  
  @param digestStream
  @return The checksum value of the stream's contents