Code example for Adler32

Methods: getValueupdate

    protected void setChecksum(long value) {
        setLong(0, value);
    protected long calculateChecksum() { 
        Checksum checksum = new Adler32();
        checksum.update(contents, POST_CHECKSUM_START, contents.length - POST_CHECKSUM_START);
        return checksum.getValue();
     * @return true if the packet is of a valid length and the checksum is valid 
    public boolean isGood() { 
        if (contents.length < HEADER_LENGTH) {
            return false; 
        long calcd = calculateChecksum();
        long curr = getChecksum();
Stop searching for code, let great code find you!  Add Codota to your java IDE