ru.protek.component.xzip
Class XCRC32

java.lang.Object
  extended by ru.protek.component.xzip.XCRC32
All Implemented Interfaces:
java.util.zip.Checksum

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

The checksum implamintation.


Constructor Summary
XCRC32()
           
 
Method Summary
 long getValue()
          Returns the XCRC32 data checksum computed so far.
 void reset()
          Resets the XCRC32 data checksum as if no update was ever called.
 void update(byte[] buf)
          Adds the complete byte array to the data checksum.
 void update(byte[] buf, int off, int len)
          Adds the byte array to the data checksum.
 void update(int bval)
          Updates the checksum with the int bval.
 int update(int theCRC, int bval)
           
 int update1(int theCRC, int bval)
          Updates the checksum theCRC with the int bval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XCRC32

public XCRC32()
Method Detail

getValue

public long getValue()
Returns the XCRC32 data checksum computed so far.

Specified by:
getValue in interface java.util.zip.Checksum

reset

public void reset()
Resets the XCRC32 data checksum as if no update was ever called.

Specified by:
reset in interface java.util.zip.Checksum

update

public int update(int theCRC,
                  int bval)

update1

public int update1(int theCRC,
                   int bval)
Updates the checksum theCRC with the int bval.

Parameters:
theCRC - checksum.
bval - new byte to update.
Returns:
new checksum.

update

public void update(int bval)
Updates the checksum with the int bval.

Specified by:
update in interface java.util.zip.Checksum
Parameters:
bval - (the byte is taken as the lower 8 bits of bval)

update

public void update(byte[] buf,
                   int off,
                   int len)
Adds the byte array to the data checksum.

Specified by:
update in interface java.util.zip.Checksum
Parameters:
buf - the buffer which contains the data
off - the offset in the buffer where the data starts
len - the length of the data

update

public void update(byte[] buf)
Adds the complete byte array to the data checksum.