public static class MessageDigestCalculatingInputStream.MessageDigestMaintainingObserver extends ObservableInputStream.Observer
Modifier and Type | Field and Description |
---|---|
private java.security.MessageDigest |
md |
Constructor and Description |
---|
MessageDigestMaintainingObserver(java.security.MessageDigest pMd)
Creates an MessageDigestMaintainingObserver for the given MessageDigest.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
data(byte[] pBuffer,
int pOffset,
int pLength)
Called to indicate, that
InputStream.read(byte[]) , or
InputStream.read(byte[], int, int) have been called, and are about to
invoke data. |
(package private) void |
data(int pByte)
Called to indicate, that
InputStream.read() has been invoked
on the ObservableInputStream , and will return a value. |
closed, error, finished
public MessageDigestMaintainingObserver(java.security.MessageDigest pMd)
pMd
- the message digest to usevoid data(int pByte) throws java.io.IOException
ObservableInputStream.Observer
InputStream.read()
has been invoked
on the ObservableInputStream
, and will return a value.data
in class ObservableInputStream.Observer
pByte
- 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 occursvoid data(byte[] pBuffer, int pOffset, int pLength) throws java.io.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
pBuffer
- The byte array, which has been passed to the read call, and where
data has been stored.pOffset
- The offset within the byte array, where data has been stored.pLength
- The number of bytes, which have been stored in the byte array.java.io.IOException
- if an i/o-error occurs