Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ClassLib.Common.java.util.zip
Class CRC32  view CRC32 download CRC32.java

java.lang.Object
  extended byClassLib.Common.java.util.zip.CRC32
All Implemented Interfaces:
java.util.zip.Checksum

public abstract class CRC32
extends java.lang.Object
implements java.util.zip.Checksum

CRC32

Version:
$Id: CRC32.java,v 1.4 2003/05/12 10:04:53 joewhaley Exp $

Field Summary
private  int crc
          The crc data checksum so far.
private static int[] crc_table
          The fast CRC table.
 
Constructor Summary
CRC32()
           
 
Method Summary
 long getValue()
          Returns the CRC32 data checksum computed so far.
private static int[] make_crc_table()
          Make the table for a fast CRC.
 void reset()
          Resets the CRC32 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crc

private int crc
The crc data checksum so far.


crc_table

private static int[] crc_table
The fast CRC table. Computed once when the CRC32 class is loaded.

Constructor Detail

CRC32

public CRC32()
Method Detail

make_crc_table

private static int[] make_crc_table()
Make the table for a fast CRC.


getValue

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

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

reset

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

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

update

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

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

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

update

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