public static String getMD5Checksum(InputStream is) throws IOException {

		byte[] digest = null;
		try {
			MessageDigest md = MessageDigest.getInstance(JawrConstant.MD5_ALGORITHM);
			InputStream digestIs = new DigestInputStream(is, md);
			// read stream to EOF as normal...
			while (digestIs.read() != -1) {

			}
			digest = md.digest();
		} catch (NoSuchAlgorithmException e) {
			throw new BundlingProcessException("MD5 algorithm needs to be installed", e);
		}

		return new BigInteger(1, digest).toString(16);
	}
public static String getMD5Checksum ( InputStream is ) throws IOException { byte [ ] digest = null ; try { MessageDigest md = MessageDigest . getInstance ( JawrConstant . MD5_ALGORITHM ) ; InputStream digestIs = new DigestInputStream ( is , md ) ; while ( digestIs . read ( ) != - 1 ) { } digest = md . digest ( ) ; } catch ( NoSuchAlgorithmException e ) { throw new BundlingProcessException ( "MD5 algorithm needs to be installed" , e ) ; } return new BigInteger ( 1 , digest ) . toString ( 16 ) ; }
Returns the MD5 Checksum of the input stream

@param is
the input stream

@return the Checksum of the input stream
@throws IOException
if an IO exception occurs