public class Delta extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CHUNK_SIZE
Default size of 16.
|
Constructor and Description |
---|
Delta()
Constructs a new Delta.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
compute(byte[] source,
byte[] target)
Compares the source bytes with target bytes, returning output.
|
void |
compute(byte[] source,
byte[] target,
OutputStream output)
Compares the source bytes with target bytes, writing to output.
|
void |
compute(byte[] sourceBytes,
InputStream inputStream,
DiffWriter diffWriter)
Compares the source bytes with target input, writing to output.
|
void |
compute(File sourceFile,
File targetFile,
DiffWriter output)
Compares the source file with a target file, writing to output.
|
void |
compute(SeekableSource seekSource,
InputStream targetIS,
DiffWriter output)
Compares the source with a target, writing to output.
|
static void |
main(String[] argv)
Creates a patch using file names.
|
void |
setChunkSize(int size)
Sets the chunk size used.
|
public static final int DEFAULT_CHUNK_SIZE
Use a size like 64 or 128 for large files.
public Delta()
public void setChunkSize(int size)
size
- public void compute(byte[] source, byte[] target, OutputStream output) throws IOException
IOException
public byte[] compute(byte[] source, byte[] target) throws IOException
IOException
public void compute(byte[] sourceBytes, InputStream inputStream, DiffWriter diffWriter) throws IOException
IOException
public void compute(File sourceFile, File targetFile, DiffWriter output) throws IOException
output
- will be closedIOException
public void compute(SeekableSource seekSource, InputStream targetIS, DiffWriter output) throws IOException
output
- will be closedIOException