com.nothome.delta
Class GDiffWriter

java.lang.Object
  extended by com.nothome.delta.GDiffWriter
All Implemented Interfaces:
DiffWriter, Closeable

public class GDiffWriter
extends Object
implements DiffWriter

Outputs a diff following the GDIFF file specification available at http://www.w3.org/TR/NOTE-gdiff-19970901.html.


Field Summary
static int CHUNK_SIZE
          Max length of a chunk.
static int COPY_INT_INT
           
static int COPY_INT_UBYTE
           
static int COPY_INT_USHORT
           
static int COPY_LONG_INT
           
static int COPY_USHORT_INT
           
static int COPY_USHORT_UBYTE
           
static int COPY_USHORT_USHORT
           
static int DATA_INT
           
static int DATA_MAX
          Max length for single length data encode.
static int DATA_USHORT
           
static byte EOF
           
 
Constructor Summary
GDiffWriter(DataOutputStream os)
          Constructs a new GDiffWriter.
GDiffWriter(OutputStream output)
          Constructs a new GDiffWriter.
 
Method Summary
 void addCopy(long offset, int length)
          Add a GDIFF copy instruction.
 void addData(byte b)
          Adds a data byte.
 void close()
          Writes the final EOF byte, closes the underlying stream.
 void flush()
          Flushes accumulated data bytes, if any.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHUNK_SIZE

public static final int CHUNK_SIZE
Max length of a chunk.

See Also:
Constant Field Values

EOF

public static final byte EOF
See Also:
Constant Field Values

DATA_MAX

public static final int DATA_MAX
Max length for single length data encode.

See Also:
Constant Field Values

DATA_USHORT

public static final int DATA_USHORT
See Also:
Constant Field Values

DATA_INT

public static final int DATA_INT
See Also:
Constant Field Values

COPY_USHORT_UBYTE

public static final int COPY_USHORT_UBYTE
See Also:
Constant Field Values

COPY_USHORT_USHORT

public static final int COPY_USHORT_USHORT
See Also:
Constant Field Values

COPY_USHORT_INT

public static final int COPY_USHORT_INT
See Also:
Constant Field Values

COPY_INT_UBYTE

public static final int COPY_INT_UBYTE
See Also:
Constant Field Values

COPY_INT_USHORT

public static final int COPY_INT_USHORT
See Also:
Constant Field Values

COPY_INT_INT

public static final int COPY_INT_INT
See Also:
Constant Field Values

COPY_LONG_INT

public static final int COPY_LONG_INT
See Also:
Constant Field Values
Constructor Detail

GDiffWriter

public GDiffWriter(DataOutputStream os)
            throws IOException
Constructs a new GDiffWriter.

Throws:
IOException

GDiffWriter

public GDiffWriter(OutputStream output)
            throws IOException
Constructs a new GDiffWriter.

Throws:
IOException
Method Detail

addCopy

public void addCopy(long offset,
                    int length)
             throws IOException
Description copied from interface: DiffWriter
Add a GDIFF copy instruction.

Specified by:
addCopy in interface DiffWriter
Throws:
IOException

addData

public void addData(byte b)
             throws IOException
Adds a data byte.

Specified by:
addData in interface DiffWriter
Throws:
IOException

flush

public void flush()
           throws IOException
Flushes accumulated data bytes, if any.

Specified by:
flush in interface DiffWriter
Throws:
IOException

close

public void close()
           throws IOException
Writes the final EOF byte, closes the underlying stream.

Specified by:
close in interface DiffWriter
Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2003-2008. All Rights Reserved.