org.kc7bfi.jflac.util
Class CRC8

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

public final class CRC8
extends Object

Utility class to calculate 8-bit CRC.

Author:
kc7bfi

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

Constructor Detail

CRC8

public CRC8()
Method Detail

update

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

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

updateBlock

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

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

calc

public static byte calc(byte[] data,
                        int len)
Calculate the CRC value with data from a byte array.

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


Copyright © 2004-2011. All Rights Reserved.