org.rhq.core.util.stream
Class StreamCopyDigest
java.lang.Object
org.rhq.core.util.stream.StreamCopyDigest
public class StreamCopyDigest
- extends Object
This copies stream data to another stream, while calculating the stream's message
digest on the fly as the copy is performed.
- Author:
- John Mazzitelli
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamCopyDigest
public StreamCopyDigest()
StreamCopyDigest
public StreamCopyDigest(MessageDigestGenerator generator)
getMessageDigestGenerator
public MessageDigestGenerator getMessageDigestGenerator()
- Returns:
- the generator used to calculate digests/hashcodes
copyAndCalculateHashcode
public String copyAndCalculateHashcode(InputStream in,
OutputStream out)
- Copies the input stream data to the output stream and returns the
copied data's digest string.
Note: the streams are never closed - the caller is responsible for that.
- Parameters:
in - input contentout - where to write the input content
- Returns:
- the copied content's digest string (aka hashcode)
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.