org.kc7bfi.jflac.util
Class CRC16

java.lang.Object
  extended by org.kc7bfi.jflac.util.CRC16

public final class CRC16
extends Object

Utility class to calculate 16-bit CRC.

Author:
kc7bfi

Constructor Summary
CRC16()
           
 
Method Summary
static short calc(byte[] data, int len)
          Calculate the CRC over a byte array.
static short update(byte data, short crc)
          Update the CRC with the byte data.
static short updateBlock(byte[] data, int len, short crc)
          Update the CRC with the byte array data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRC16

public CRC16()
Method Detail

update

public static short update(byte data,
                           short crc)
Update the CRC with the byte data.

Parameters:
data - The byte data
crc - The starting CRC value
Returns:
The updated CRC value

updateBlock

public static short updateBlock(byte[] data,
                                int len,
                                short crc)
Update the CRC with the byte array data.

Parameters:
data - The byte array data
len - The byte array length
crc - The starting CRC value
Returns:
The updated CRC value

calc

public static short calc(byte[] data,
                         int len)
Calculate the CRC over a byte array.

Parameters:
data - The byte data
len - The byte array length
Returns:
The calculated CRC value


Copyright © 2004-2011. All Rights Reserved.