|
Chapter 18 The java.util.zip Package |
|
CRC32
Name
CRC32
- Class Name:
-
java.util.zip.CRC32
- Superclass:
-
java.lang.Object
- Immediate Subclasses:
-
None
- Interfaces Implemented:
-
java.util.zip.Checksum
- Availability:
-
New as of JDK 1.1
The CRC32 class implements
the Checksum interface using
the CRC-32 algorithm. This algorithm is significantly slower than Adler-32 and only slightly more reliable.
public class java.util.zip.CRC32 extends java.lang.Object
implements java.util.zip.Checksum {
// Constructors
public CRC32();
// Instance Methods
public long getValue();
public void reset();
public void update(int b);
public void update(byte[] b);
public native void update(byte[] b, int off, int len);
}
- Description
-
This constructor creates an CRC32
object.
- Returns
-
The current checksum value.
- Implements
-
Checksum.getValue()
- Description
-
This method returns the current value of this checksum.
- Implements
-
Checksum.reset()
- Description
-
This method resets the checksum to its initial value, making it appear as though
it has not been updated by any data.
- Parameters
-
- b
-
The value to be added
to the data stream for the checksum calculation.
- Implements
-
Checksum.update(int)
- Description
-
This method adds the specified value to the data stream and updates the
checksum value. The method uses only the lowest eight bits of the given
int.
- Parameters
-
- b
-
An array of bytes to
be added to the data stream for the checksum calculation.
- Description
-
This method adds the bytes from the specified array to the data stream
and updates the checksum value.
- Parameters
-
- b
-
An array of bytes to
be added to the data stream for the checksum calculation.
- off
-
An offset into the byte array.
- len
-
The number of bytes to use.
- Implements
-
Checksum.update(byte[], int, int)
- Description
-
This method adds len bytes
from the specified array, starting at off,
to the data stream and updates the checksum value.
|
|