import java.util.zip.*; public class HomeBrew implements Checksum { protected long sum; // a very simplistically calculated checksum //------------------------------------------------------------------- // HomeBrew Constructor //------------------------------------------------------------------- public HomeBrew() { reset(); } //------------------------------------------------------------------- // Checksum methods //------------------------------------------------------------------- public void update(int b) { sum += b; } public void update(byte b[], int off, int len) { for (int i=off ; (i-off) < len; i++) { sum += b[i]; } } public long getValue() { return sum; } public void reset() { sum = 0; } } // End of Class HomeBrew