public class Checksum extends Object
Constructor and Description |
---|
Checksum(SeekableSource source,
int chunkSize)
Initialize checksums for source.
|
Modifier and Type | Method and Description |
---|---|
int |
findChecksumIndex(long hashf)
Finds the index of a checksum.
|
static char[] |
getSingleHash()
256 random hash values.
|
static long |
incrementChecksum(long checksum,
byte out,
byte in,
int chunkSize)
Increments a checksum.
|
static long |
queryChecksum(ByteBuffer bb,
int len)
Finds the checksum computed from the buffer.
|
String |
toString()
Returns a debug
String . |
public Checksum(SeekableSource source, int chunkSize) throws IOException
chunkSize
bytes at offset
chunkSize
* i is inserted into a hash map.IOException
public static long queryChecksum(ByteBuffer bb, int len)
public static long incrementChecksum(long checksum, byte out, byte in, int chunkSize)
checksum
- initial checksumout
- byte leaving viewin
- byte entering viewchunkSize
- size of chunkspublic static char[] getSingleHash()
public int findChecksumIndex(long hashf)