Package com.aoindustries.md5
Class MD5InputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.aoindustries.md5.MD5InputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class MD5InputStream extends FilterInputStream
MD5InputStream is a subclass of FilterInputStream adding MD5 hashing of the read input.- Version:
- $Revision: 1.2 $
- Author:
- Santeri Paavolainen <santtu@cs.hut.fi>
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description MD5InputStream(InputStream in)Creates a MD5InputStream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]hash()Returns array of bytes representing hash of the stream as finalized for the current state.intread()Read a byte of data.intread(byte[] bytes, int offset, int length)Reads into an array of bytes.-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
-
-
-
-
Constructor Detail
-
MD5InputStream
public MD5InputStream(InputStream in)
Creates a MD5InputStream- Parameters:
in- The input stream
-
-
Method Detail
-
read
public int read() throws IOExceptionRead a byte of data.- Overrides:
readin classFilterInputStream- Throws:
IOException- See Also:
FilterInputStream
-
read
public int read(byte[] bytes, int offset, int length) throws IOExceptionReads into an array of bytes.- Overrides:
readin classFilterInputStream- Throws:
IOException
-
hash
public byte[] hash()
Returns array of bytes representing hash of the stream as finalized for the current state.- See Also:
MD5.Final()
-
-