Package org.apache.commons.io.input
Class MessageDigestInputStream.MessageDigestMaintainingObserver
- java.lang.Object
 - 
- org.apache.commons.io.input.ObservableInputStream.Observer
 - 
- org.apache.commons.io.input.MessageDigestInputStream.MessageDigestMaintainingObserver
 
 
 
- 
- Enclosing class:
 - MessageDigestInputStream
 
public static class MessageDigestInputStream.MessageDigestMaintainingObserver extends ObservableInputStream.Observer
Maintains the message digest. 
- 
- 
Constructor Summary
Constructors Constructor Description MessageDigestMaintainingObserver(java.security.MessageDigest messageDigest)Constructs an MessageDigestMaintainingObserver for the given MessageDigest. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddata(byte[] input, int offset, int length)Called to indicate thatInputStream.read(byte[]), orInputStream.read(byte[], int, int)have been called, and are about to invoke data.voiddata(int input)Called to indicate, thatInputStream.read()has been invoked on theObservableInputStream, and will return a value.- 
Methods inherited from class org.apache.commons.io.input.ObservableInputStream.Observer
closed, error, finished 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
MessageDigestMaintainingObserver
public MessageDigestMaintainingObserver(java.security.MessageDigest messageDigest)
Constructs an MessageDigestMaintainingObserver for the given MessageDigest.- Parameters:
 messageDigest- the message digest to use- Throws:
 java.lang.NullPointerException- if messageDigest is null.
 
 - 
 
- 
Method Detail
- 
data
public void data(byte[] input, int offset, int length) throws java.io.IOExceptionDescription copied from class:ObservableInputStream.ObserverCalled to indicate thatInputStream.read(byte[]), orInputStream.read(byte[], int, int)have been called, and are about to invoke data.- Overrides:
 datain classObservableInputStream.Observer- Parameters:
 input- The byte array, which has been passed to the read call, and where data has been stored.offset- The offset within the byte array, where data has been stored.length- The number of bytes, which have been stored in the byte array.- Throws:
 java.io.IOException- if an I/O error occurs.
 
- 
data
public void data(int input) throws java.io.IOExceptionDescription copied from class:ObservableInputStream.ObserverCalled to indicate, thatInputStream.read()has been invoked on theObservableInputStream, and will return a value.- Overrides:
 datain classObservableInputStream.Observer- Parameters:
 input- The value, which is being returned. This will never be -1 (EOF), because, in that case,ObservableInputStream.Observer.finished()will be invoked instead.- Throws:
 java.io.IOException- if an I/O error occurs.
 
 - 
 
 -