if (vers != 2 && vers != 3)
throw new IOException(MessageFormat.format(
JGitText.get().unsupportedPackVersion, Long.valueOf(vers)));
if (packCnt != idx.getObjectCount())
throw new PackMismatchException(MessageFormat.format(
JGitText.get().packObjectCountMismatch,
Long.valueOf(packCnt), Long.valueOf(idx.getObjectCount()),
getPackFile()));
fd.seek(length - 20);
fd.readFully(buf, 0, 20);
if (!Arrays.equals(buf, packChecksum))
throw new PackMismatchException(MessageFormat.format(
JGitText.get().packObjectCountMismatch
, ObjectId.fromRaw(buf).name()
, ObjectId.fromRaw(idx.packChecksum).name()
, getPackFile()));
}