com.eyebolt.iplib
Class CRC16

java.lang.Object
  |
  +--com.eyebolt.iplib.CRC16

class CRC16
extends java.lang.Object

The CRC-16 class calculates a 16 bit cyclic redundancy check of a set of bytes. This error detecting code is used to determine if bit rot has occured in a byte stream.

Author:
jgardner

Field Summary
private  int value
          value contains the currently computed CRC, set to 0 initally
 
Constructor Summary
CRC16()
          Constructor for the CRC16 object
 
Method Summary
 int getValue()
          value accessor
 void reset()
          reset CRC value to 0
 void update(byte aByte)
          update CRC with byte b
 void update(byte[] bytes)
          update CRC with an array of bytes
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

value

private int value
value contains the currently computed CRC, set to 0 initally
Constructor Detail

CRC16

public CRC16()
Constructor for the CRC16 object
Method Detail

getValue

public int getValue()
value accessor
Returns:
The Value value

update

public void update(byte aByte)
update CRC with byte b
Parameters:
aByte - Description of Parameter

update

public void update(byte[] bytes)
update CRC with an array of bytes
Parameters:
bytes - Description of Parameter

reset

public void reset()
reset CRC value to 0


Copyright © 2001 Eyebolt, Inc.