net.rim.device.api.util
Class CRC16
java.lang.Object
|
+--net.rim.device.api.util.CRC16
- public final class CRC16
- extends Object
Computes the 16-bit CRC (checksum) for a data stream.
Based on FCS-16 specified in RFC 1662 (STD 51).
|
Field Summary |
static int |
INITIAL_VALUE
Initial checksum value used before updates. |
|
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 checksum with a section of provided array of bytes.
|
static int |
update(int crc,
int b)
Updates the checksum with the specified byte.
|
INITIAL_VALUE
public static final int INITIAL_VALUE
- Initial checksum value used before updates.
update
public static int update(int crc,
int b)
- Updates the checksum with the specified byte.
- Parameters:
crc - Checksum to update.b - Byte with which to update the checksum.- Returns:
- Resulting checksum value.
- Since:
- JDE 3.6
update
public static int update(int crc,
byte[] b)
- Updates the checksum with the specified array of bytes.
- Parameters:
crc - Checksum to update.b - Byte array with which to update the checksum.- Returns:
- Resulting checksum value.
- Since:
- JDE 3.6
update
public static int update(int crc,
byte[] b,
int offset,
int length)
- Updates the checksum with a section of provided array of bytes.
- Parameters:
crc - Checksum to update.b - Byte array containing the section with which to update the checksum.off - First element in the byte array used to update the checksum.len - Number of bytes in the section used to update the checksum.- Returns:
- Resulting checksum value.
- Since:
- JDE 3.6
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.