net.sf.jpkgmk.util
Class UnixChecksum

java.lang.Object
  extended by net.sf.jpkgmk.util.UnixChecksum
All Implemented Interfaces:
java.util.zip.Checksum

public class UnixChecksum
extends java.lang.Object
implements java.util.zip.Checksum

Implementation of the unix algorithm "cksum". For further information see For details on the concrete algorithm that was used see http://www.opengroup.org/onlinepubs/009695399/utilities/cksum.html

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 $
See Also:
http://users.cs.cf.ac.uk/htbin/systems/fedmanpage?1p+cksum

Constructor Summary
UnixChecksum()
           
 
Method Summary
static long createChecksum(byte[] data)
           
static long createChecksum(java.io.File file)
           
 long getValue()
           
 void reset()
           
 void update(byte[] data)
           
 void update(byte[] data, int off, int len)
           
 void update(int byt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnixChecksum

public UnixChecksum()
Method Detail

createChecksum

public static long createChecksum(java.io.File file)
                           throws java.io.IOException
Throws:
java.io.IOException

createChecksum

public static long createChecksum(byte[] data)

getValue

public long getValue()
Specified by:
getValue in interface java.util.zip.Checksum

reset

public void reset()
Specified by:
reset in interface java.util.zip.Checksum

update

public void update(int byt)
Specified by:
update in interface java.util.zip.Checksum

update

public void update(byte[] data)

update

public void update(byte[] data,
                   int off,
                   int len)
Specified by:
update in interface java.util.zip.Checksum


Copyright © 2007-2008. All Rights Reserved.