com.nothome.delta.text
Class Checksum

java.lang.Object
  extended by com.nothome.delta.text.Checksum

public class Checksum
extends Object

Checksum that uses character streams.


Field Summary
protected  gnu.trove.TLongIntHashMap checksums
           
static boolean debug
           
 
Constructor Summary
Checksum(Readable source, int chunkSize)
          Initialize checksums for source.
 
Method Summary
 int findChecksumIndex(long hashf)
           
static long incrementChecksum(long checksum, char out, char in, int chunkSize)
           
static long queryChecksum(CharBuffer bb, int len)
          Marks, gets, then resets the checksum computed from the buffer.
 String toString()
          Returns a debug String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

public static boolean debug

checksums

protected gnu.trove.TLongIntHashMap checksums
Constructor Detail

Checksum

public Checksum(Readable source,
                int chunkSize)
         throws IOException
Initialize checksums for source. The checksum for the chunkSize bytes at offset chunkSize * i is inserted into an array at index i.

Throws:
IOException
Method Detail

queryChecksum

public static long queryChecksum(CharBuffer bb,
                                 int len)
Marks, gets, then resets the checksum computed from the buffer.


incrementChecksum

public static long incrementChecksum(long checksum,
                                     char out,
                                     char in,
                                     int chunkSize)

findChecksumIndex

public int findChecksumIndex(long hashf)

toString

public String toString()
Returns a debug String.

Overrides:
toString in class Object


Copyright © 2003-2008. All Rights Reserved.