public class BinaryDelta extends Object
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 and Description |
|---|
BinaryDelta() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.Copyright © 2014. All rights reserved.