Package totalcross.util.zip
Class CRC32
- java.lang.Object
-
- totalcross.util.zip.Checksum
-
- totalcross.util.zip.CRC32
-
public class CRC32 extends Checksum
Computes CRC32 data checksum of a data stream. The actual CRC32 algorithm is described in RFC 1952 (GZIP file format specification version 4.3). Can be used to get the CRC32 over a stream if used with checked input/output streams. Changes for TotalCross:
Extends the abstract class Checksum (which was originally an interface).
-
-
Constructor Summary
Constructors Constructor Description CRC32()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetValue()Returns the CRC32 data checksum computed so far.voidreset()Resets the CRC32 data checksum as if no update was ever called.voidupdate(byte[] buf)Adds the complete byte array to the data checksum.voidupdate(byte[] buf, int off, int len)Adds the byte array to the data checksum.voidupdate(int bval)Updates the checksum with the int bval.
-
-
-
Method Detail
-
getValue
public long getValue()
Returns the CRC32 data checksum computed so far.
-
reset
public void reset()
Resets the CRC32 data checksum as if no update was ever called.
-
update
public void update(int bval)
Updates the checksum with the int bval.- 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.- Parameters:
buf- the buffer which contains the dataoff- the offset in the buffer where the data startslen- the length of the data
-
update
public void update(byte[] buf)
Adds the complete byte array to the data checksum.
-
-