public class Checksum
extends java.lang.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(java.nio.ByteBuffer bb,
int len)
Finds the checksum computed from the buffer.
|
java.lang.String |
toString()
Returns a debug
String . |
public Checksum(SeekableSource source, int chunkSize) throws java.io.IOException
chunkSize
bytes at offset
chunkSize
* i is inserted into a hash map.java.io.IOException
public static long queryChecksum(java.nio.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)
public java.lang.String toString()
String
.toString
in class java.lang.Object