|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.protocols.ip.OC16ChecksumProducer
public final class OC16ChecksumProducer
Produces a one's compliment 16-bit checksum from data that is "added" to the sum. The producer handles objects from 8-bits to 64-bit values.
| Constructor Summary | |
|---|---|
OC16ChecksumProducer()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
add(byte b)
Adds the specified 8-bit value to the checksum. |
void |
add(byte a,
byte b)
Adds the specified 8-bit values to the checksum. |
void |
add(int i)
Adds the specified 32-bit value to the checksum. |
void |
add(long l)
Adds the specified 64-bit value to the checksum. |
void |
add(short s)
Adds the specified 16-bit value to the checksum total. |
short |
getChecksum()
Returns the current checksum value that has been computed for the object. |
void |
reset()
Resets the object to a zero state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OC16ChecksumProducer()
| Method Detail |
|---|
public void add(byte b)
b - The 8-bit value to add to the checksum.
public void add(byte a,
byte b)
a - The high order 8-bitsb - The low order 8-bitspublic void add(short s)
s - The 16-bit value to addpublic void add(int i)
i - The 32-bit value.public void add(long l)
l - The 64-bit value to addpublic void reset()
public short getChecksum()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||