|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.storage.pack.BinaryDelta
public class BinaryDelta
Recreate a stream from a base stream and a GIT pack delta.
This entire class is heavily cribbed from patch-delta.c
in the
GIT project. The original delta patching code was written by Nicolas Pitre
(<nico@cam.org>).
Constructor Summary | |
---|---|
BinaryDelta()
|
Method Summary | |
---|---|
static byte[] |
apply(byte[] base,
byte[] delta)
Apply the changes defined by delta to the data in base, yielding a new array of bytes. |
static byte[] |
apply(byte[] base,
byte[] delta,
byte[] result)
Apply the changes defined by delta to the data in base, yielding a new array of bytes. |
static String |
format(byte[] delta)
Format this delta as a human readable string. |
static String |
format(byte[] delta,
boolean includeHeader)
Format this delta as a human readable string. |
static long |
getBaseSize(byte[] delta)
Length of the base object in the delta stream. |
static long |
getResultSize(byte[] delta)
Length of the resulting object in the delta stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BinaryDelta()
Method Detail |
---|
public static long getBaseSize(byte[] delta)
delta
- the delta stream, or at least the header of it.
public static long getResultSize(byte[] delta)
delta
- the delta stream, or at least the header of it.
public static final byte[] apply(byte[] base, byte[] delta)
base
- some byte representing an object of some kind.delta
- a git pack delta defining the transform from one version to
another.
public static final byte[] apply(byte[] base, byte[] delta, byte[] result)
base
- some byte representing an object of some kind.delta
- a git pack delta defining the transform from one version to
another.result
- array to store the result into. If null the result will be
allocated and returned.
result
, or the result array allocated.public static String format(byte[] delta)
delta
- the delta instruction sequence to format.
public static String format(byte[] delta, boolean includeHeader)
delta
- the delta instruction sequence to format.includeHeader
- true if the header (base size and result size) should be
included in the formatting.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |