Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jempeg.empeg.protocol
Class CRC32  view CRC32 download CRC32.java

java.lang.Object
  extended byorg.jempeg.empeg.protocol.CRC32

public class CRC32
extends java.lang.Object

The CRC implementation that was "borrowed" from our friends at Empeg.

Version:
$Revision: 1.4 $

Field Summary
static int[] crc32tab
           
private  int myValue
           
 
Constructor Summary
CRC32()
          Creates a new CRC16 and resets the value
 
Method Summary
 EmpegUINT16 getValue()
          Returns the current CRC value
 void reset()
          Resets the CRC value
 void update(byte[] _buffer)
          Updates the CRC with an array of unsigned 8-bit values (cast as bytes)
 void update(byte[] _buffer, int _offset, int _length)
          Updates the CRC with an array of unsigned 8-bit values (cast as bytes)
 void update(int _value)
          Updates the value with the unsigned 8-bit value
 void update(int[] _buffer)
          Updates the CRC with an array of unsigned 8-bit values (cast as ints)
 void update(short[] _buffer)
          Updates the CRC with an array of unsigned 8-bit values (cast as shorts)
 void updateSigned16(int _value)
          Updates the CRC with a signed 16-bit value
 void updateSigned32(int _value)
          Updates the CRC with a signed 32-bit value
 void updateSigned8(int _value)
          Updates the CRC with a signed 8-bit value
 void updateUnsigned16(int _value)
          Updates the CRC with an unsigned 16-bit value
 void updateUnsigned32(long _value)
          Updates the CRC with an unsigned 32-bit value
 void updateUnsigned8(int _value)
          Updates the CRC with an unsigned 8-bit value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crc32tab

public static final int[] crc32tab

myValue

private int myValue
Constructor Detail

CRC32

public CRC32()
Creates a new CRC16 and resets the value

Method Detail

update

public final void update(byte[] _buffer)
Updates the CRC with an array of unsigned 8-bit values (cast as bytes)


update

public final void update(byte[] _buffer,
                         int _offset,
                         int _length)
Updates the CRC with an array of unsigned 8-bit values (cast as bytes)


update

public final void update(short[] _buffer)
Updates the CRC with an array of unsigned 8-bit values (cast as shorts)


update

public final void update(int[] _buffer)
Updates the CRC with an array of unsigned 8-bit values (cast as ints)


updateSigned8

public final void updateSigned8(int _value)
Updates the CRC with a signed 8-bit value


updateUnsigned8

public final void updateUnsigned8(int _value)
Updates the CRC with an unsigned 8-bit value


updateSigned16

public final void updateSigned16(int _value)
Updates the CRC with a signed 16-bit value


updateUnsigned16

public final void updateUnsigned16(int _value)
Updates the CRC with an unsigned 16-bit value


updateSigned32

public final void updateSigned32(int _value)
Updates the CRC with a signed 32-bit value


updateUnsigned32

public final void updateUnsigned32(long _value)
Updates the CRC with an unsigned 32-bit value


update

public final void update(int _value)
Updates the value with the unsigned 8-bit value


getValue

public final EmpegUINT16 getValue()
Returns the current CRC value


reset

public final void reset()
Resets the CRC value