net.sf.jpkgmk.util
Class ChecksumUtil

java.lang.Object
  extended by net.sf.jpkgmk.util.ChecksumUtil

public class ChecksumUtil
extends java.lang.Object

Since:
1.0
Version:
$Revision: 2 $ $Date: 2008-08-20 21:14:19 +0200 (Mi, 20 Aug 2008) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Method Summary
static java.lang.Long createChecksum(java.io.File file, java.util.zip.Checksum checksum)
          Returns the checksum for the given file
static java.lang.Long createChecksumCrc32(java.io.File file)
          Returns the CRC32 checksum for the given file
static java.lang.Long createUnixCksum(byte[] data)
           
static java.lang.Long createUnixCksum(java.io.File file)
           
static java.lang.String md5(java.io.File data)
           
static java.lang.String md5(java.io.InputStream data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

md5

public static java.lang.String md5(java.io.File data)
                            throws java.security.NoSuchAlgorithmException,
                                   java.io.IOException
Parameters:
data -
Returns:
The MD5 checksum as hex string
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException

md5

public static java.lang.String md5(java.io.InputStream data)
                            throws java.security.NoSuchAlgorithmException,
                                   java.io.IOException
Parameters:
data -
Returns:
The MD5 checksum as hex string
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException

createChecksumCrc32

public static java.lang.Long createChecksumCrc32(java.io.File file)
                                          throws java.io.IOException
Returns the CRC32 checksum for the given file

Parameters:
file -
Returns:
Throws:
java.io.IOException

createUnixCksum

public static java.lang.Long createUnixCksum(java.io.File file)
                                      throws java.io.IOException,
                                             java.security.NoSuchAlgorithmException
Throws:
java.io.IOException
java.security.NoSuchAlgorithmException

createUnixCksum

public static java.lang.Long createUnixCksum(byte[] data)
                                      throws java.io.IOException,
                                             java.security.NoSuchAlgorithmException
Throws:
java.io.IOException
java.security.NoSuchAlgorithmException

createChecksum

public static java.lang.Long createChecksum(java.io.File file,
                                            java.util.zip.Checksum checksum)
                                     throws java.io.IOException
Returns the checksum for the given file

Parameters:
file -
checksum -
Returns:
Throws:
java.io.IOException


Copyright © 2007-2008. All Rights Reserved.