|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metastatic.rsync.Rdiff
A re-implementation of the rdiff
utility from librsync.
For more info see the rproxy
page.
Field Summary | |
---|---|
protected int |
blockLength
The length of blocks to checksum. |
static short |
CHAR_OFFSET
|
static int |
CHUNK_SIZE
|
static String |
DELTA
The `delta' command. |
static int |
DELTA_MAGIC
Rdiff/rproxy delta magic. |
protected static LongOpt[] |
LONGOPTS
The long options. |
static byte |
OP_COPY_N4_N4
|
static byte |
OP_END
|
static byte |
OP_LITERAL_N1
|
static byte |
OP_LITERAL_N2
|
static byte |
OP_LITERAL_N4
|
static byte |
OP_LITERAL_N8
|
protected static String |
OPTSTRING
The short options. |
static String |
PATCH
The `patch' command. |
static String |
PROGNAME
The program name printed to the console. |
static int |
RDIFF_BLOCK_LENGTH
Rdiff/rproxy default block length. |
static int |
RDIFF_STRONG_LENGTH
Rdiff/rproxy default sum length. |
static int |
SIG_MAGIC
Rdiff/rproxy signature magic. |
static String |
SIGNATURE
The `signature' command. |
protected int |
strongSumLength
The effective strong signature length. |
static int |
SUM_LENGTH
The strong checksum length. |
protected static boolean |
verbose
Whether or not to trace to System.err. |
Constructor Summary | |
---|---|
Rdiff()
Create an Rdiff object. |
Method Summary | |
---|---|
static void |
main(String[] argv)
Main entry point for console use. |
List |
makeDeltas(List sums,
InputStream in)
Make a collection of Delta s from the given sums and
InputStream. |
void |
makeDeltas(List sums,
InputStream in,
OutputStream out)
|
List |
makeSignatures(InputStream in)
Make the signatures from data coming in through the input stream. |
void |
makeSignatures(InputStream in,
OutputStream out)
Generate and write the signatures. |
List |
readDeltas(InputStream in)
Read a collection of Delta s from the InputStream. |
List |
readSignatures(InputStream in)
Read the signatures from the input stream. |
void |
rebuildFile(File basis,
InputStream deltas,
OutputStream out)
|
void |
rebuildFile(File basis,
List deltas,
OutputStream out)
Patch the file basis using deltas ,
writing the patched file to out . |
void |
writeDeltas(List deltas,
OutputStream out)
Write deltas to an output stream. |
void |
writeSignatures(List sigs,
OutputStream out)
Write the signatures to the specified output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String OPTSTRING
protected static final LongOpt[] LONGOPTS
public static final int SUM_LENGTH
public static final int CHUNK_SIZE
public static final int RDIFF_BLOCK_LENGTH
public static final int RDIFF_STRONG_LENGTH
public static final int SIG_MAGIC
public static final int DELTA_MAGIC
public static final byte OP_END
public static final byte OP_LITERAL_N1
public static final byte OP_LITERAL_N2
public static final byte OP_LITERAL_N4
public static final byte OP_LITERAL_N8
public static final byte OP_COPY_N4_N4
public static final String SIGNATURE
public static final String DELTA
public static final String PATCH
public static final String PROGNAME
public static final short CHAR_OFFSET
protected static boolean verbose
protected int blockLength
protected int strongSumLength
Constructor Detail |
public Rdiff()
Method Detail |
public static void main(String[] argv) throws Throwable
argv
- The argument vector.
Throwable
public void makeSignatures(InputStream in, OutputStream out) throws IOException, NoSuchAlgorithmException
IOException
NoSuchAlgorithmException
public void writeSignatures(List sigs, OutputStream out) throws IOException
sigs
- The signatures to write.out
- The OutputStream to write to.
IOException
- If writing fails.public List makeSignatures(InputStream in) throws IOException, NoSuchAlgorithmException
in
- The input stream to generate signatures for.
IOException
- If reading fails.
NoSuchAlgorithmException
public List readSignatures(InputStream in) throws IOException
in
- The InputStream to read the signatures from.
ChecksumPair
s read.
IOException
- If the input stream is malformed.public void makeDeltas(List sums, InputStream in, OutputStream out) throws IOException, NoSuchAlgorithmException
IOException
NoSuchAlgorithmException
public void writeDeltas(List deltas, OutputStream out) throws IOException
deltas
- A collection of Delta
s to write.out
- The OutputStream to write to.
IOException
- If writing fails.public List makeDeltas(List sums, InputStream in) throws IOException, NoSuchAlgorithmException
Delta
s from the given sums and
InputStream.
sums
- A collection of ChecksumPair
s generated from
the "old" file.in
- The InputStream for the "new" file.
Delta
s that will patch the old
file to the new.
IOException
- If reading fails.
NoSuchAlgorithmException
public List readDeltas(InputStream in) throws IOException
Delta
s from the InputStream.
in
- The InputStream to read from.
Delta
s read.
IOException
- If the input stream is malformed.public void rebuildFile(File basis, InputStream deltas, OutputStream out) throws IOException
IOException
public void rebuildFile(File basis, List deltas, OutputStream out) throws IOException
basis
using deltas
,
writing the patched file to out
.
basis
- The basis file.deltas
- The collection of Delta
s to apply.out
- The OutputStream to write the patched file to.
IOException
- If reading/writing fails.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |