public class DataDigestConsumer extends Object implements DataConsumer
A DataConsumer
which updates a MessageDigest
.
Constructor and Description |
---|
DataDigestConsumer(MessageDigest digest,
String name)
Creates a consumer.
|
Modifier and Type | Method and Description |
---|---|
void |
consume(byte[] buffer,
int length)
Consume the data.
|
String |
getName()
Returns the name of the consumer in the exception (if one is thrown).
|
public DataDigestConsumer(MessageDigest digest, String name)
Creates a consumer.
digest
- The digest.name
- The name of the consumer in the exception (if one is thrown).IllegalArgumentException
- If any of the parameters are null
.public String getName()
DataConsumer
Returns the name of the consumer in the exception (if one is thrown).
getName
in interface DataConsumer
public void consume(byte[] buffer, int length) throws IOException
DataConsumer
Consume the data.
consume
in interface DataConsumer
buffer
- The buffer containing the data.length
- The length which defines how much of the buffer is filled with
data.IOException
- If an I/O error occurs.Copyright © 2015–2019. All rights reserved.