bAdler.reset(); int nextBlockLength = Math.min(MATCH_BLOCK_SIZE, bLength - (lo + advance)); bAdler.update(b, lo + advance, nextBlockLength);
for (int next = lo; next < lo + advance; next++) { bAdler.remove(b[next]); if (next + MATCH_BLOCK_SIZE < bLength) { bAdler.add(b[next + MATCH_BLOCK_SIZE]); } }
    public void computeDelta(byte[] a, int aLength, byte[] b, int bLength) {        if (bLength < MATCH_BLOCK_SIZE) {            copyFromNewData(b, 0, bLength);            return;        }        Map aMatchesTable = createMatchesTable(a, aLength, MATCH_BLOCK_SIZE);        Adler32 bAdler = new Adler32();        bAdler.update(b, 0, MATCH_BLOCK_SIZE);        int lo = 0;        int size = bLength;        Match previousInsertion = null;                while(lo < size) {            Match match = findMatch(aMatchesTable, bAdler, a, aLength, b, bLength, lo, previousInsertion);            if (match == null) {                if (previousInsertion != null && previousInsertion.length > 0) {                    previousInsertion.length++;                } else {                    previousInsertion = new Match(lo, 1);                }            } else {                if (previousInsertion != null && previousInsertion.length > 0) {                    copyFromNewData(b, previousInsertion.position, previousInsertion.length);                    previousInsertion = null;                }                copyFromSource(match.position, match.length);                            }            int advance = match != null ? match.advance : 1;            bAdler.reset();            int nextBlockLength = Math.min(MATCH_BLOCK_SIZE, bLength - (lo + advance));            bAdler.update(b, lo + advance, nextBlockLength);            lo += advance;        }        if (previousInsertion != null && previousInsertion.length > 0) {            copyFromNewData(b, previousInsertion.position, previousInsertion.length);            previousInsertion = null;        }    }