com.baidubce.util
Class MD5DigestCalculatingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.baidubce.util.MD5DigestCalculatingInputStream
- All Implemented Interfaces:
- Closeable
public class MD5DigestCalculatingInputStream
- extends FilterInputStream
Simple InputStream wrapper that examines the wrapped stream's contents as they are read and calculates and MD5
digest.
Method Summary |
byte[] |
getMd5Digest()
|
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
void |
reset()
Resets the wrapped input stream and the in progress message digest. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MD5DigestCalculatingInputStream
public MD5DigestCalculatingInputStream(InputStream in)
throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
getMd5Digest
public byte[] getMd5Digest()
reset
public void reset()
throws IOException
- Resets the wrapped input stream and the in progress message digest.
- Overrides:
reset
in class FilterInputStream
- Throws:
IOException
- See Also:
InputStream.reset()
read
public int read()
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
- See Also:
InputStream.read()
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
- See Also:
InputStream.read(byte[], int, int)
Copyright © 2018. All rights reserved.