public class Rsum extends Object implements RollingChecksum, Cloneable, Serializable
| Constructor and Description |
|---|
Rsum()
Constructor of rolling checksum
|
| Modifier and Type | Method and Description |
|---|---|
void |
check(byte[] buf,
int offset,
int length)
Update the checksum with an entirely different block, and
potentially a different block length.
|
Object |
clone()
Copies this checksum instance into a new instance.
|
boolean |
equals(Object o)
Tests if a particular checksum is equal to this checksum.
|
void |
first(byte[] buf,
int offset,
int length)
Update the checksum with an entirely different block, and
potentially a different block length.
|
int |
getValue()
Return the value of the currently computed checksum.
|
void |
reset()
Reset the checksum
|
void |
roll(byte newByte)
Rolling checksum that takes single byte and compute checksum
of block from file in offset that equals offset of newByte
minus length of block
|
public int getValue()
getValue in interface RollingChecksumpublic void reset()
reset in interface RollingChecksumpublic void roll(byte newByte)
roll in interface RollingChecksumnewByte - New byte that will actualize a checksumpublic void check(byte[] buf,
int offset,
int length)
check in interface RollingChecksumbuf - The byte array that holds the new block.offset - From whence to begin reading.length - The length of the block to read.public void first(byte[] buf,
int offset,
int length)
first in interface RollingChecksumbuf - The byte array that holds the new block.offset - From whence to begin reading.length - The length of the block to read.public Object clone()
RollingChecksumCloneable interface.clone in interface RollingChecksumclone in class Objectpublic boolean equals(Object o)
RollingChecksumequals in interface RollingChecksumequals in class Objecto - The object to test.true if this checksum equals the other
checksum.Copyright © 2021 McEvoy Software Ltd. All rights reserved.