| java.lang.Object java.io.InputStream java.io.FilterInputStream HTTPClient.MD5InputStream
MD5InputStream | class MD5InputStream extends FilterInputStream (Code) | | This class calculates a running md5 digest of the data read. When the
stream is closed the calculated digest is passed to a HashVerifier which
is expected to verify this digest and to throw an Exception if it fails.
version: 0.3-2 18/06/1999 author: Ronald Tschalär |
Method Summary | |
public synchronized void | close() Close the stream and check the digest. | public synchronized int | read() | public synchronized int | read(byte[] buf, int off, int len) | public synchronized long | skip(long num) |
MD5InputStream | public MD5InputStream(InputStream is, HashVerifier verifier)(Code) | | Parameters: is - the input stream over which the md5 hash is to be calculated Parameters: verifier - the HashVerifier to invoke when the stream is closed |
close | public synchronized void close() throws IOException(Code) | | Close the stream and check the digest. If the stream has not been
fully read then the rest of the data will first be read (and discarded)
to complete the digest calculation.
exception: IOException - if the close()'ing the underlying stream throwsan IOException, or if the expected digest andthe calculated digest don't match. |
read | public synchronized int read(byte[] buf, int off, int len) throws IOException(Code) | | |
|
|