|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metastatic.rsync.DeltaEncoder
The superclass of objects that encode sets of deltas to external representations, such as the over-the-wire format of rsync or the rdiff file format.
Subclasses MAY define themselves to be accessable through the
#getInstance(java.lang.String,java.io.OutputStream)
method
by providing a one-argument constructor that accepts an OutputStream
and defining the system property
"jarsync.deltaEncoder.encoding-name".
Field Summary | |
---|---|
protected Configuration |
config
The configuration. |
protected OutputStream |
out
The output stream. |
static String |
PROPERTY
|
Constructor Summary | |
---|---|
DeltaEncoder(Configuration config,
OutputStream out)
Creates a new delta encoder. |
Method Summary | |
---|---|
abstract void |
doFinal()
Finish encoding the deltas (at least, this set of deltas) and write any encoding-specific end-of-deltas entity. |
static DeltaEncoder |
getInstance(String encoding,
Configuration config,
OutputStream out)
Returns a new instance of the specified encoder. |
abstract boolean |
requiresOrder()
Returns whether or not this encoder requires the deltas it is presented to be in write offset order, that is, the deltas passed to the write methods must be presented
in increasing order of their Delta.getWriteOffset()
values. |
abstract void |
write(Delta d)
Write (encode) a single delta to the output stream. |
void |
write(List deltas)
Write (encode) a list of deltas to the output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PROPERTY
protected Configuration config
protected OutputStream out
Constructor Detail |
public DeltaEncoder(Configuration config, OutputStream out)
config
- The configuration.out
- The output stream to write the data to.Method Detail |
public static final DeltaEncoder getInstance(String encoding, Configuration config, OutputStream out)
IllegalArgumentException
- If there is no appropriate
encoder available.public void write(List deltas) throws IOException
doFinal()
.
This method checks every element of the supplied list to ensure that
all are either non-null or implement the Delta
interface, before
writing any data.
deltas
- The list of deltas to write.
IOException
- If an I/O error occurs.
IllegalArgumentException
- If any element of the list is not
a Delta
.
NullPointerException
- If any element is null.public abstract void write(Delta d) throws IOException
d
- The delta to write.
IOException
- If an I/O error occurs.public abstract void doFinal() throws IOException
IOException
- If an I/O error occurs.public abstract boolean requiresOrder()
write
methods must be presented
in increasing order of their Delta.getWriteOffset()
values.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |