This entire class is heavily cribbed from patch-delta.c in the
GIT project. The original delta patching code was written by Nicolas Pitre
(<[email protected]>).
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static final byte[] | Returns: patched basesome byte representing an object of some kind. base, byte[] a git pack delta defining the transform from one version to
another. delta)Apply the changes defined by delta to the data in base, yielding a new array of bytes. |
| public static final byte[] | Returns: eitherresult, or the result array allocated.some byte representing an object of some kind. base, final byte[] a git pack delta defining the transform from one version to
another. delta, byte[] array to store the result into. If null the result will be
allocated and returned. result)Apply the changes defined by delta to the data in base, yielding a new array of bytes. |
| public static String | Returns: the formatted delta.the delta instruction sequence to format. delta)Format this delta as a human readable string. |
| public static String | Returns: the formatted delta.the delta instruction sequence to format. delta, boolean true if the header (base size and result size) should be
included in the formatting. includeHeader)Format this delta as a human readable string. |
| public static long | Returns: the base object's size.the delta stream, or at least the header of it. delta)Length of the base object in the delta stream. |
| public static long | Returns: the resulting object's size.the delta stream, or at least the header of it. delta)Length of the resulting object in the delta stream. |
| BinaryDelta | back to summary |
|---|---|
| public BinaryDelta() | |
| apply | back to summary |
|---|---|
| public static final byte[] apply(byte[] base, byte[] delta) Apply the changes defined by delta to the data in base, yielding a new array of bytes.
| |
| apply | back to summary |
|---|---|
| public static final byte[] apply(final byte[] base, final byte[] delta, byte[] result) Apply the changes defined by delta to the data in base, yielding a new array of bytes.
| |
| format | back to summary |
|---|---|
| public static String format(byte[] delta) Format this delta as a human readable string.
| |
| format | back to summary |
|---|---|
| public static String format(byte[] delta, boolean includeHeader) Format this delta as a human readable string.
| |
| getBaseSize | back to summary |
|---|---|
| public static long getBaseSize(byte[] delta) Length of the base object in the delta stream.
| |
| getResultSize | back to summary |
|---|---|
| public static long getResultSize(byte[] delta) Length of the resulting object in the delta stream.
| |