Skip to content

Most visited

Recently visited

navigation
Added in API level 1

CRC32

public class CRC32
extends Object implements Checksum

java.lang.Object
   ↳ java.util.zip.CRC32


The CRC32 class is used to compute a CRC32 checksum from data provided as input value. See also Adler32 which is almost as good, but cheaper.

Summary

Public constructors

CRC32()

Public methods

long getValue()

Returns the CRC32 checksum for all input received.

void reset()

Resets the CRC32 checksum to it initial state.

void update(byte[] buf, int offset, int byteCount)

Update this CRC32 checksum with the contents of buf, starting from offset and reading byteCount bytes of data.

void update(int val)

Updates this checksum with the byte value provided as integer.

void update(byte[] buf)

Updates this checksum with the bytes contained in buffer buf.

Inherited methods

From class java.lang.Object
From interface java.util.zip.Checksum

Public constructors

CRC32

Added in API level 1
CRC32 ()

Public methods

getValue

Added in API level 1
long getValue ()

Returns the CRC32 checksum for all input received.

Returns
long The checksum for this instance.

reset

Added in API level 1
void reset ()

Resets the CRC32 checksum to it initial state.

update

Added in API level 1
void update (byte[] buf, 
                int offset, 
                int byteCount)

Update this CRC32 checksum with the contents of buf, starting from offset and reading byteCount bytes of data.

Parameters
buf byte: the byte array from which to read the bytes.
offset int: the initial position in buf to read the bytes from.
byteCount int: the number of bytes to read from buf.

update

Added in API level 1
void update (int val)

Updates this checksum with the byte value provided as integer.

Parameters
val int: represents the byte to update the checksum.

update

Added in API level 1
void update (byte[] buf)

Updates this checksum with the bytes contained in buffer buf.

Parameters
buf byte: the buffer holding the data to update the checksum with.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.