return this;
}
+ /**
+ * @return size of the reverse index, in bytes.
+ */
+ public int getReverseIndexSize() {
+ return (int) Math.min(objectCount * 8, Integer.MAX_VALUE);
+ }
+
/** @return number of objects in the pack. */
public long getObjectCount() {
return objectCount;
return revidx;
}
- PackIndex fwdidx = idx(ctx);
- PackReverseIndex revidx = new PackReverseIndex(fwdidx);
- long objCnt = fwdidx.getObjectCount();
- int sz = (int) Math.min(objCnt * 8, Integer.MAX_VALUE);
- reverseIndex = cache.put(key, POS_REVERSE_INDEX, sz, revidx);
+ PackReverseIndex revidx = new PackReverseIndex(idx(ctx));
+ reverseIndex = cache.put(key, POS_REVERSE_INDEX,
+ packDesc.getReverseIndexSize(), revidx);
return revidx;
}
}