net.rim.device.api.util
Class CRC24

java.lang.Object
  |
  +--net.rim.device.api.util.CRC24

public final class CRC24
extends Object

A class that can be used to compute a 24-bit CRC of a data stream. Based on CRC-24 specified in RFC 2440.


Field Summary
static int INITIAL_VALUE
           
 
Method Summary
static int update(int crc, byte[] b)
          Updates the checksum with the specified array of bytes.
static int update(int crc, byte[] b, int offset, int length)
          Updates the current checksum with the specified array of bytes.
static int update(int crc, int b)
          Updates the checksum with the specified byte.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_VALUE

public static final int INITIAL_VALUE
Method Detail

update

public static int update(int crc,
                         int b)
Updates the checksum with the specified byte.
Parameters:
crc - the checksum to update
b - the byte to update the checksum with
Returns:
the current checksum value
Since:
JDE 3.7.0

update

public static int update(int crc,
                         byte[] b)
Updates the checksum with the specified array of bytes.
Parameters:
crc - the checksum to update
b - the byte array to update the checksum with
Returns:
the current checksum value
Since:
JDE 3.7.0

update

public static int update(int crc,
                         byte[] b,
                         int offset,
                         int length)
Updates the current checksum with the specified array of bytes.
Parameters:
crc - the checksum to update
b - the byte array to update the checksum with
off - the start offset of the data
len - the number of bytes to use for the update
Returns:
the current checksum value
Since:
JDE 3.7.0


Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.