public static class MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver extends ObservableInputStream.Observer
| Constructor and Description |
|---|
MessageDigestMaintainingObserver(MessageDigest messageDigest)
Creates 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(MessageDigest messageDigest)
messageDigest - the message digest to usepublic void data(int input) throws 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.IOException - if an i/o-error occurspublic void data(byte[] input, int offset, int length) throws 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.IOException - if an i/o-error occursCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.