public final class ChecksumHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
byteArrayToHexString(byte[] in)
Convert a byte[] array to readable string format.
|
static void |
check(java.io.File dest,
java.io.File checksumFile,
java.lang.String algorithm)
Checks the checksum of the given file against the given checksumFile, and throws an
IOException if the checksum is not compliant
|
static java.lang.String |
computeAsString(java.io.File f,
java.lang.String algorithm) |
static boolean |
isKnownAlgorithm(java.lang.String algorithm) |
public static void check(java.io.File dest, java.io.File checksumFile, java.lang.String algorithm) throws java.io.IOException
dest
- the file to testchecksumFile
- the file containing the expected checksumalgorithm
- the checksum algorithm to usejava.io.IOException
- if an IO problem occur whle reading files or if the checksum is not compliantpublic static java.lang.String computeAsString(java.io.File f, java.lang.String algorithm) throws java.io.IOException
java.io.IOException
public static boolean isKnownAlgorithm(java.lang.String algorithm)
public static java.lang.String byteArrayToHexString(byte[] in)
in
- byte[] buffer to convert to string format