public class Patch
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static long |
checksum(byte[] input) |
static Patch |
createAdd(java.lang.String targetPath,
byte[] patchedData,
java.util.EnumSet<PatchBase> bases) |
static Patch |
createModified(java.lang.String targetPath,
byte[] baseData,
byte[] patchedData,
java.util.EnumSet<PatchBase> bases,
DiffOptions options) |
static Patch |
createRemove(java.lang.String targetPath,
java.util.EnumSet<PatchBase> bases) |
static void |
from(java.lang.String targetPath,
java.util.EnumMap<PatchBase,byte[]> baseData,
byte[] patchedData,
DiffOptions options,
java.util.function.Consumer<Patch> consumer) |
long |
getBaseChecksum()
Checksum for the base file of the patch.
|
long |
getBaseChecksumUnsigned()
Returns the base checksum as an unsigned long value.
|
java.util.EnumSet<PatchBase> |
getBaseTypes() |
byte[] |
getData()
Returns the entry data.
|
PatchOperation |
getOperation() |
java.lang.String |
getTargetPath() |
public PatchOperation getOperation()
public java.lang.String getTargetPath()
public java.util.EnumSet<PatchBase> getBaseTypes()
public long getBaseChecksum()
Only available for entries where getOperation() is PatchOperation.MODIFY.
Otherwise, the value is -1.
public byte[] getData()
public long getBaseChecksumUnsigned()
public static void from(java.lang.String targetPath,
java.util.EnumMap<PatchBase,byte[]> baseData,
byte[] patchedData,
DiffOptions options,
java.util.function.Consumer<Patch> consumer)
throws java.io.IOException
baseData - Null values indicate that the patch base did not contain the target path.patchedData - Null indicates the target path has been removed from the patched jar.java.io.IOExceptionpublic static Patch createAdd(java.lang.String targetPath, byte[] patchedData, java.util.EnumSet<PatchBase> bases)
public static Patch createRemove(java.lang.String targetPath, java.util.EnumSet<PatchBase> bases)
public static Patch createModified(java.lang.String targetPath, byte[] baseData, byte[] patchedData, java.util.EnumSet<PatchBase> bases, DiffOptions options) throws java.io.IOException
java.io.IOExceptionpublic static long checksum(byte[] input)