Package org.apache.commons.io.input
Class MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver
- java.lang.Object
-
- org.apache.commons.io.input.ObservableInputStream.Observer
-
- org.apache.commons.io.input.MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver
-
- Enclosing class:
- MessageDigestCalculatingInputStream
public static class MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver extends ObservableInputStream.Observer
Maintains the message digest.
-
-
Constructor Summary
Constructors Constructor Description MessageDigestMaintainingObserver(java.security.MessageDigest messageDigest)
Creates an MessageDigestMaintainingObserver for the given MessageDigest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
data(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.void
data(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
-
-
-
-
Method Detail
-
data
public void data(int input) throws java.io.IOException
Description copied from class:ObservableInputStream.Observer
Called to indicate, thatInputStream.read()
has been invoked on theObservableInputStream
, and will return a value.- Overrides:
data
in 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.
-
data
public void data(byte[] input, int offset, int length) throws java.io.IOException
Description copied from class:ObservableInputStream.Observer
Called to indicate thatInputStream.read(byte[])
, orInputStream.read(byte[], int, int)
have been called, and are about to invoke data.- Overrides:
data
in 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.
-
-