MdInputStream(URL url,InputStream in,MessageDigest messageDigest,byte[] expectedDigest){
  if (url == null || in == null || messageDigest == null) {
    throw new NullPointerException();
  }
  this.url=url;
  this.in=in;
  this.messageDigest=messageDigest;
  this.expectedDigest=expectedDigest.clone();
}

MdInputStream ( URL url , InputStream in , MessageDigest messageDigest , byte [ ] expectedDigest ) { if ( url == null || in == null || messageDigest == null ) { throw new NullPointerException ( ) ; } this . url = url ; this . in = in ; this . messageDigest = messageDigest ; this . expectedDigest = expectedDigest . clone ( ) ; }
creates an input stream that checks the contents of another input stream against a message digest . the stream throws wrongmessagedigestexception if the end of the other input stream is reached and the contents did not have the expected message digest .
