//
return wc.open(getObjectId()).openStream();
}
delta = new InflaterInputStream(delta);
final ObjectLoader base = pack.load(wc, baseOffset);
DeltaStream ds = new DeltaStream(delta) {
private long baseSize = SIZE_UNKNOWN;
@Override
protected InputStream openBase() throws IOException {
InputStream in;
if (base instanceof LargePackedDeltaObject)
in = ((LargePackedDeltaObject) base).open(wc);
else
in = base.openStream();
if (baseSize == SIZE_UNKNOWN) {
if (in instanceof DeltaStream)
baseSize = ((DeltaStream) in).getSize();
else if (in instanceof ObjectStream)
baseSize = ((ObjectStream) in).getSize();
}
return in;
}
@Override
protected long getBaseSize() throws IOException {
if (baseSize == SIZE_UNKNOWN) {
// This code path should never be used as DeltaStream
// is supposed to open the stream first, which would
// initialize the size for us directly from the stream.
baseSize = base.getSize();
}
return baseSize;
}
};
if (type == Constants.OBJ_BAD) {
if (!(base instanceof LargePackedDeltaObject))
type = base.getType();
}
if (size == SIZE_UNKNOWN)
size = ds.getSize();
return ds;
}