private Match findMatch(Map matchesTable, Adler32 checksum, byte[] a, int aLength, byte[] b, int bLength, int bPos, Match previousInsertion) { Match existingMatch = (Match) matchesTable.get(new Long(checksum.getValue()));
private static Match findMatch(Map matchesTable, PseudoAdler32 checksum, byte[] a, int aLength, byte[] b, int bLength, int bPos, Match previousInsertion) { Match existingMatch = (Match) matchesTable.get(new Integer(checksum.getValue()));
    private Match findMatch(Map matchesTable, Adler32 checksum, byte[] a, int aLength, byte[] b, int bLength, int bPos, Match previousInsertion) {        Match existingMatch = (Match) matchesTable.get(new Long(checksum.getValue()));        if (existingMatch == null) {            return null;        }        // compare bytes in b at bpos with those in a at match        if (!equals(a, aLength, existingMatch.position, existingMatch.length, b, bLength, bPos)) {            return null;        }        existingMatch = new Match(existingMatch.position, existingMatch.length);        existingMatch.advance = existingMatch.length;        // extend forward         while(existingMatch.position + existingMatch.length < aLength &&                bPos + existingMatch.advance < bLength &&                a[existingMatch.position + existingMatch.length] == b[bPos + existingMatch.advance]) {            existingMatch.length++;            existingMatch.advance++;        }        // extend backward        if (previousInsertion != null) {            while(existingMatch.position > 0 && bPos > 0 &&                    a[existingMatch.position - 1] == b[bPos -1] &&                    previousInsertion.length != 0) {                previousInsertion.length--;                bPos--;                existingMatch.position--;                existingMatch.length++;            }        }        return existingMatch;    }