com.intland.codebeamer.utils
Class StreamDigester
java.lang.Object
com.intland.codebeamer.utils.StreamDigester
public class StreamDigester
- extends java.lang.Object
Constructor Summary |
StreamDigester()
Create a default StreamDigester that creates MD5 checksums |
StreamDigester(java.lang.String algorithm)
Create a new StreamDigester that creates checksums with the specified algorithm |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamDigester
public StreamDigester()
- Create a default StreamDigester that creates MD5 checksums
StreamDigester
public StreamDigester(java.lang.String algorithm)
- Create a new StreamDigester that creates checksums with the specified algorithm
- Parameters:
algorithm
- is the MessageDigest algorithm to use
createCheckSum
public java.lang.String createCheckSum(java.lang.String filename)
throws java.io.IOException
- Throws:
java.io.IOException
createCheckSum
public java.lang.String createCheckSum(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException
createCheckSum
public java.lang.String createCheckSum(java.io.InputStream fis)
throws java.io.IOException
- Throws:
java.io.IOException
createCheckSum
public java.lang.String createCheckSum(byte[] bytes)
throws java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchAlgorithmException
digest2String
public static java.lang.String digest2String(byte[] digest)
getAlgorithm
public java.lang.String getAlgorithm()
- Returns:
- the algorithm
setAlgorithm
public void setAlgorithm(java.lang.String algorithm)
- Parameters:
algorithm
- the algorithm to set
Copyright © 2006-2009 Intland Software. All rights reserved.