|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nothome.delta.Delta
public class Delta
Class for computing deltas against a source. The source file is read by blocks and a hash is computed per block. Then the target is scanned for matching blocks.
This class is not thread safe. Use one instance per thread.
This class should support files over 4GB in length, although you must use a larger checksum size, such as 1K, as all checksums use "int" indexing. Newer versions may eventually support paging in/out of checksums.
Field Summary | |
---|---|
static int |
DEFAULT_CHUNK_SIZE
Default size of 16. |
Constructor Summary | |
---|---|
Delta()
Constructs a new Delta. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_CHUNK_SIZE
Use a size like 64 or 128 for large files.
Constructor Detail |
---|
public Delta()
Method Detail |
---|
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 closed
IOException
public void compute(SeekableSource seekSource, InputStream targetIS, DiffWriter output) throws IOException
output
- will be closed
IOException
public static void main(String[] argv) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |