public < D extends MD5Descriptor > D digest ( InputStream stream , DigestOperation < D > digestOperation ) throws IOException { DigestInputStream digestInputStream = new DigestInputStream ( stream , md5Digest ) ; D md5Descriptor = digestOperation . execute ( digestInputStream ) ; String md5 = DatatypeConverter . printHexBinary ( md5Digest . digest ( ) ) ; md5Descriptor . setMd5 ( md5 ) ; return md5Descriptor ; }
Calculate the MD5 hash sum for the given input stream using the given operation .