public static class MessageDigestInputStream.MessageDigestMaintainingObserver extends ObservableInputStream.Observer
| Modifier and Type | Field and Description |
|---|---|
private java.security.MessageDigest |
messageDigest |
| Constructor and Description |
|---|
MessageDigestMaintainingObserver(java.security.MessageDigest messageDigest)
Constructs an MessageDigestMaintainingObserver for the given MessageDigest.
|
| Modifier and Type | Method and Description |
|---|---|
void |
data(byte[] input,
int offset,
int length)
Called to indicate that
InputStream.read(byte[]), or InputStream.read(byte[], int, int) have
been called, and are about to invoke data. |
void |
data(int input)
Called to indicate, that
InputStream.read() has been invoked on the ObservableInputStream,
and will return a value. |
closed, error, finishedpublic MessageDigestMaintainingObserver(java.security.MessageDigest messageDigest)
messageDigest - the message digest to usejava.lang.NullPointerException - if messageDigest is null.public void data(byte[] input,
int offset,
int length)
throws java.io.IOException
ObservableInputStream.ObserverInputStream.read(byte[]), or InputStream.read(byte[], int, int) have
been called, and are about to invoke data.data in class ObservableInputStream.Observerinput - 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.java.io.IOException - if an I/O error occurs.public void data(int input)
throws java.io.IOException
ObservableInputStream.ObserverInputStream.read() has been invoked on the ObservableInputStream,
and will return a value.data in class ObservableInputStream.Observerinput - The value, which is being returned. This will never be -1 (EOF), because, in that case,
ObservableInputStream.Observer.finished() will be invoked instead.java.io.IOException - if an I/O error occurs.