|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metastatic.rsync.DataBlock
This is the Delta
in the rsync algorithm that introduces new
data. It is an array of bytes and an offset, such that the updated
file should contain this block at the given offset.
Field Summary | |
---|---|
protected byte[] |
data
The block of data to insert. |
protected long |
offset
The offset in the file to start this block. |
Constructor Summary | |
---|---|
DataBlock(long offset,
byte[] data)
Create a new instance of a DataBlock with a given offset and block of bytes. |
|
DataBlock(long offset,
byte[] data,
int off,
int len)
Create a new instance of a DataBlock with a given offset and a portion of a byte array. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Test if another object equals this one. |
int |
getBlockLength()
The size of the block of data this class represents. |
byte[] |
getData()
Return the array of bytes that is the data block. |
long |
getOffset()
Get the offset at which this block should begin. |
long |
getWriteOffset()
Get the offset at which this Delta should be written. |
int |
hashCode()
Return the hash code for this data block. |
String |
toString()
Return a printable string that represents this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final byte[] data
protected final long offset
Constructor Detail |
public DataBlock(long offset, byte[] data)
offset
- The offset where this data should go.data
- The data itself.public DataBlock(long offset, byte[] data, int off, int len)
offset
- The write offset of this data block.data
- The data itself.off
- The offset in the array to begin copying.len
- The number of bytes to copy.Method Detail |
public long getWriteOffset()
Delta
getWriteOffset
in interface Delta
public int getBlockLength()
Delta
getBlockLength
in interface Delta
public long getOffset()
public byte[] getData()
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
ClassCastException
- If o is not an
instance of this class.
NullPointerException
- If o is null.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |