Class MD5InputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.FilterInputStream
              |
              +--MD5InputStream

public class MD5InputStream
extends java.io.FilterInputStream

MD5InputStream is a subclass of FilterInputStream adding MD5 hashing of the read input.


Field Summary
private  MD5 md5
          MD5 context
 
Fields inherited from class java.io.FilterInputStream
in
 
Fields inherited from class java.io.InputStream
SKIP_BUFFER_SIZE, skipBuffer
 
Constructor Summary
MD5InputStream(java.io.InputStream in)
          Creates a MD5InputStream
 
Method Summary
 byte[] hash()
          Returns array of bytes representing hash of the stream as finalized for the current state.
 int read()
          Read a byte of data.
 int read(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
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

md5

private MD5 md5
MD5 context
Constructor Detail

MD5InputStream

public MD5InputStream(java.io.InputStream in)
Creates a MD5InputStream
Parameters:
in - The input stream
Method Detail

read

public int read()
         throws java.io.IOException
Read a byte of data.
Overrides:
read in class java.io.FilterInputStream
See Also:
FilterInputStream

read

public int read(byte[] bytes,
                int offset,
                int length)
         throws java.io.IOException
Reads into an array of bytes.
Overrides:
read in class java.io.FilterInputStream
See Also:
java.lang.FilterInputStream

hash

public byte[] hash()
Returns array of bytes representing hash of the stream as finalized for the current state.
See Also:
MD5.Final()