|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metastatic.rsync.GeneratorStream
Field Summary | |
---|---|
protected byte[] |
buffer
The intermediate byte buffer. |
protected Configuration |
config
The configuration. |
protected long |
count
The number of bytes summed thusfar. |
protected List |
listeners
The list of GeneratorListeners . |
protected int |
ndx
The current index in buffer . |
Constructor Summary | |
---|---|
GeneratorStream(Configuration config)
|
Method Summary | |
---|---|
void |
addListener(GeneratorListener listener)
Add a GeneratorListener to the list of listeners. |
void |
doFinal()
Finish generating checksums, flushing any buffered data and resetting this instance. |
protected ChecksumPair |
generateSum(byte[] buf,
int off,
int len)
Generate a sum pair for a portion of a byte array. |
boolean |
removeListener(GeneratorListener listener)
Remove a GeneratorListener from the list of listeners. |
void |
reset()
Reset this generator, to be used for another data set. |
void |
update(byte b)
Update this generator with a single byte. |
void |
update(byte[] buf)
Update this generator with a byte array. |
void |
update(byte[] buf,
int off,
int len)
Update this generator with a portion of a byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final Configuration config
protected final List listeners
GeneratorListeners
.
protected final byte[] buffer
protected int ndx
buffer
.
protected long count
Constructor Detail |
public GeneratorStream(Configuration config)
Method Detail |
public void addListener(GeneratorListener listener)
GeneratorListener
to the list of listeners.
listener
- The listener to add.public boolean removeListener(GeneratorListener listener)
GeneratorListener
from the list of listeners.
listener
- The listener to add.
public void reset()
public void update(byte b) throws ListenerException
b
- The next byte
ListenerException
public void update(byte[] buf, int off, int len) throws ListenerException
buf
- The next bytes.off
- The offset to begin at.len
- The number of bytes to update.
ListenerException
public void update(byte[] buf) throws ListenerException
buf
- The next bytes.
ListenerException
public void doFinal() throws ListenerException
ListenerException
protected ChecksumPair generateSum(byte[] buf, int off, int len)
buf
- The byte array to checksum.off
- Where in buf
to start.len
- How many bytes to checksum.
ChecksumPair
for this byte array.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |