org.codehaus.plexus.digest
Class AbstractStreamingDigester
java.lang.Object
org.codehaus.plexus.digest.AbstractStreamingDigester
- All Implemented Interfaces:
- StreamingDigester
- Direct Known Subclasses:
- StreamingMd5Digester, StreamingSha1Digester
public abstract class AbstractStreamingDigester
- extends Object
- implements StreamingDigester
Gradually create a digest for a stream.
- Author:
- Brett Porter
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
md
protected final MessageDigest md
AbstractStreamingDigester
protected AbstractStreamingDigester(String algorithm)
getAlgorithm
public String getAlgorithm()
- Description copied from interface:
StreamingDigester
- Get the algorithm used for the checksum.
- Specified by:
getAlgorithm
in interface StreamingDigester
- Returns:
- the algorithm
calc
public String calc()
throws DigesterException
- Description copied from interface:
StreamingDigester
- Calculate the current checksum.
- Specified by:
calc
in interface StreamingDigester
- Returns:
- the current checksum.
- Throws:
DigesterException
- if there was a problem computing the hashcode.
reset
public void reset()
throws DigesterException
- Description copied from interface:
StreamingDigester
- Reset the hashcode calculation algorithm.
Only useful when performing incremental hashcodes based on repeated use of
StreamingDigester.update(InputStream)
- Specified by:
reset
in interface StreamingDigester
- Throws:
DigesterException
- if there was a problem with the internal message digest
update
public void update(InputStream is)
throws DigesterException
- Description copied from interface:
StreamingDigester
- Update the checksum with the content of the input stream.
- Specified by:
update
in interface StreamingDigester
- Parameters:
is
- the input stream
- Throws:
DigesterException
- if there was a problem computing the hashcode.
calc
protected static String calc(MessageDigest md)
update
protected static void update(InputStream is,
MessageDigest digest)
throws DigesterException
- Throws:
DigesterException
Copyright © 2001-2011 Codehaus. All Rights Reserved.