Skip to content

An Java encoder/decoder for the VCDIFF (RFC3284) format

License

Notifications You must be signed in to change notification settings

ehrmann/vcdiff-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI Coverage Status Maven Central

VCDiff-java

A Java port of Google's open-vcdiff vcdiff (RFC3284) implementation. It's currently synced with open-vcdiff 0.8.4.

Download

Maven:

<dependency>
    <groupId>com.davidehrmann.vcdiff</groupId>
    <artifactId>vcdiff-core</artifactId>
    <version>0.1.1</version>
</dependency>

Gradle:

compile 'com.davidehrmann.vcdiff:vcdiff-core:0.1.1'

Usage

Encoding (compressing)

byte[] dictionary = ...;
byte[] uncompressedData = ...;
OutputStream compressedData = ...;

// OutputStream (like GZIPOutputStream) and stream-based encoders are
// also available from the builder.
VCDiffEncoder<OutputStream> encoder = VCDiffEncoderBuilder.builder()
    .withDictionary(dictionary)
    .buildSimple();

encoder.encode(uncompressedData, compressedData);

Decoding (decompressing)

byte[] dictionary = ...;
byte[] compressedData = ...;
OutputStream uncompressedData = ...;

// InputStream (like GZIPInputStream) and stream-based decoders are
// also available from the builder.
VCDiffDecoder decoder = VCDiffDecoderBuilder.builder().buildSimple();
decoder.decode(dictionary, compressedData, uncompressedData);

Command line usage

The command line wrapper for java-vcdiff is generally compatble with the open-vcdiff implementation:

# Compress original with dictionary dict to compressed.vcdiff
java com.davidehrmann.vcdiff.VCDiffFileBasedCoder encode -dictionary dict -delta compressed.vcdiff -target original

# Decompress compressed.vcdiff with dictionary dict to decompressed
java com.davidehrmann.vcdiff.VCDiffFileBasedCoder decode -dictionary dict -delta compressed.vcdiff -target decompressed

# Usage details
java com.davidehrmann.vcdiff.VCDiffFileBasedCoder help

The command line tool is available in the Central Repository

Maven:

<dependency>
    <groupId>com.davidehrmann.vcdiff</groupId>
    <artifactId>vcdiff-cli</artifactId>
    <version>0.1.1</version>
</dependency>

Gradle:

compile 'com.davidehrmann.vcdiff:vcdiff-cli:0.1.1'

Compatability

xdelta3

xdelta3 has extensions that aren't currently supported by vcdiff-java: the application header, adler32 checksum, and secondary compression. When encoding, passing -S -A -n to xdelta3 will disable these features.

See also

About

An Java encoder/decoder for the VCDIFF (RFC3284) format

Resources

License

Stars

Watchers

Forks

Packages

No packages published