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