/** * Format this delta as a human readable string. * * @param delta * the delta instruction sequence to format. * @return the formatted delta. */ public static String format(byte[] delta) { return format(delta, true); }
return BinaryDelta.getResultSize(getDeltaHeader(curs, deltaAt)); } catch (DataFormatException e) { throw new CorruptObjectException(MessageFormat.format(
/** * Apply the changes defined by delta to the data in base, yielding a new * array of bytes. * * @param base * some byte representing an object of some kind. * @param delta * a git pack delta defining the transform from one version to * another. * @return patched base */ public static final byte[] apply(byte[] base, byte[] delta) { return apply(base, delta, null); }
checkIfTooLarge(type, BinaryDelta.getResultSize(delta)); visit.data = BinaryDelta.apply(visit.parent.data, delta); delta = null;
@Override protected void run() throws Exception { ObjectReader reader = db.newObjectReader(); RevObject obj = new RevWalk(reader).parseAny(objectId); byte[] delta = getDelta(reader, obj); // We're crossing our fingers that this will be a delta. Double // check the size field in the header, it should match. // long size = reader.getObjectSize(obj, obj.getType()); try { if (BinaryDelta.getResultSize(delta) != size) throw die("Object " + obj.name() + " is not a delta"); } catch (ArrayIndexOutOfBoundsException bad) { throw die("Object " + obj.name() + " is not a delta"); } outw.println(BinaryDelta.format(delta)); }
final long sz = BinaryDelta.getResultSize(cmds); if (Integer.MAX_VALUE <= sz) throw new LargeObjectException.ExceedsByteArrayLimit(); BinaryDelta.apply(data, cmds, result); data = result; delta = delta.next;
final long sz = BinaryDelta.getResultSize(cmds); if (Integer.MAX_VALUE <= sz) throw new LargeObjectException.ExceedsByteArrayLimit(); BinaryDelta.apply(data, cmds, result); data = result; delta = delta.next;
return BinaryDelta.getResultSize(getDeltaHeader(ctx, deltaAt)); } catch (DataFormatException dfe) { throw new CorruptObjectException(
/** * Format this delta as a human readable string. * * @param delta * the delta instruction sequence to format. * @return the formatted delta. */ public static String format(byte[] delta) { return format(delta, true); }
/** * Apply the changes defined by delta to the data in base, yielding a new * array of bytes. * * @param base * some byte representing an object of some kind. * @param delta * a git pack delta defining the transform from one version to * another. * @return patched base */ public static final byte[] apply(byte[] base, byte[] delta) { return apply(base, delta, null); }
checkIfTooLarge(type, BinaryDelta.getResultSize(delta)); visit.data = BinaryDelta.apply(visit.parent.data, delta); delta = null;
return BinaryDelta.getResultSize(getDeltaHeader(ctx, deltaAt)); } catch (DataFormatException dfe) { throw new CorruptObjectException(
/** * Format this delta as a human readable string. * * @param delta * the delta instruction sequence to format. * @return the formatted delta. */ public static String format(byte[] delta) { return format(delta, true); }
/** * Apply the changes defined by delta to the data in base, yielding a new * array of bytes. * * @param base * some byte representing an object of some kind. * @param delta * a git pack delta defining the transform from one version to * another. * @return patched base */ public static final byte[] apply(final byte[] base, final byte[] delta) { return apply(base, delta, null); }
checkIfTooLarge(type, BinaryDelta.getResultSize(delta)); visit.data = BinaryDelta.apply(visit.parent.data, delta); delta = null;
return BinaryDelta.getResultSize(getDeltaHeader(curs, deltaAt)); } catch (DataFormatException e) { throw new CorruptObjectException(MessageFormat.format(
final long sz = BinaryDelta.getResultSize(cmds); if (Integer.MAX_VALUE <= sz) throw new LargeObjectException.ExceedsByteArrayLimit(); BinaryDelta.apply(data, cmds, result); data = result; delta = delta.next;
return BinaryDelta.getResultSize(getDeltaHeader(curs, deltaAt)); } catch (DataFormatException e) { throw new CorruptObjectException(MessageFormat.format(
final long sz = BinaryDelta.getResultSize(cmds); if (Integer.MAX_VALUE <= sz) throw new LargeObjectException.ExceedsByteArrayLimit(); BinaryDelta.apply(data, cmds, result); data = result; delta = delta.next;
return BinaryDelta.getResultSize(getDeltaHeader(ctx, deltaAt)); } catch (DataFormatException dfe) { CorruptObjectException coe = new CorruptObjectException(