public class MakeContextEx extends MakeContext
put method to save matches to an array of Lists, rather than
to fileMap, which only allows one entry per remote block. It also overrides the delete
method to do nothing, instead of removing the ChecksumPair from the ChainingHash.
MakeContextEx is used internally by UploadMakerEx in place of MakeContext as an argument to MapMatcher.mapMatcher.UploadMakerEx| Constructor and Description |
|---|
MakeContextEx(ChainingHash hashtable,
int blockcount,
int blocksize)
Constructs a MakeContextEx from an already-initialized ChainingHash.
|
| Modifier and Type | Method and Description |
|---|---|
int |
blockcount() |
void |
delete(ChecksumPair key)
Overrides
delete in MakeContext to do nothing. |
List<OffsetPair> |
getReverseMap()
Returns a list of OffsetPairs representing the block-matches between the local and
remote file.
|
boolean |
matched(int blockIndex) |
void |
put(int blockIndex,
long offset)
Adds a match to the list of block matches.
|
void |
removematch(int blockIndex) |
public MakeContextEx(ChainingHash hashtable, int blockcount, int blocksize)
hashtable - The hashtable obtained from a MetaFileReaderblockcount - The number of blocks in the remote fileblocksize - The number of bytes per blockpublic List<OffsetPair> getReverseMap()
OffsetPairpublic void put(int blockIndex,
long offset)
put in class MakeContextblockIndex - Index of the remote blockoffset - Byte offset of the local blockpublic void delete(ChecksumPair key)
delete in MakeContext to do nothing. Local blocks
with the identical checksums will all then match to the first matching ChecksumPair in ChainingHashdelete in class MakeContextkey - Unused in this override. Can be nullpublic boolean matched(int blockIndex)
matched in class MakeContextpublic void removematch(int blockIndex)
removematch in class MakeContextpublic int blockcount()
blockcount in class MakeContextCopyright © 2021 McEvoy Software Ltd. All rights reserved.