// At this point there is at least one delta to apply to data.
// (Whole objects with no deltas to apply return early above.)
if (data == null)
throw new LargeObjectException();
do {
// Cache only the base immediately before desired object.
if (cached)
cached = false;
else if (delta.next == null)
ctx.getDeltaBaseCache().put(key, delta.basePos, type, data);
pos = delta.deltaPos;
byte[] cmds = decompress(pos + delta.hdrLen, delta.deltaSize, ctx);
if (cmds == null) {
data = null; // Discard base in case of OutOfMemoryError
throw new LargeObjectException();
}
final long sz = BinaryDelta.getResultSize(cmds);
if (Integer.MAX_VALUE <= sz)
throw new LargeObjectException.ExceedsByteArrayLimit();