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, finished
public MessageDigestMaintainingObserver(MessageDigest messageDigest)
messageDigest
- the message digest to usepublic void data(int input) throws IOException
ObservableInputStream.Observer
InputStream.read()
has been invoked
on the ObservableInputStream
, and will return a value.data
in class ObservableInputStream.Observer
input
- 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.Observer
InputStream.read(byte[])
, or
InputStream.read(byte[], int, int)
have been called, and are about to
invoke data.data
in class ObservableInputStream.Observer
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.IOException
- if an i/o-error occursCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.