public class Utils
extends java.lang.Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
checksum(java.io.File file,
java.lang.String algorithm)
Calculates and returns a checksum for the passed file using the passed
algorithm.
|
static java.lang.String |
checksum(java.io.InputStream in,
java.lang.String algorithm)
Calculates and returns a checksum for the passed IO stream using the passed
algorithm.
|
static void |
copy(java.io.File inFile,
java.io.File outFile)
Performs a buffered copy from one file into another.
|
static void |
copy(java.io.InputStream in,
java.io.OutputStream out)
Performs a buffered copy from one IO stream into another.
|
static java.lang.String |
toHex(byte[] data) |
public static java.lang.String checksum(java.io.File file,
java.lang.String algorithm)
throws java.io.IOException
file - file on which to calculate checksumalgorithm - string for algorithm: 'MD5', 'SHA1', etcjava.io.IOExceptionpublic static java.lang.String checksum(java.io.InputStream in,
java.lang.String algorithm)
throws java.io.IOException
in - input stream on which to calculate checksumalgorithm - string for algorithm: 'MD5', 'SHA1', etcjava.io.IOExceptionpublic static java.lang.String toHex(byte[] data)
public static void copy(java.io.File inFile,
java.io.File outFile)
throws java.io.IOException
inFile - outFile - java.io.IOExceptionpublic static void copy(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
in - input streamout - output streamjava.io.IOExceptionCopyright © 2018 DuraSpace. All Rights Reserved.