|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metastatic.rsync.RebuilderStream | +--org.metastatic.rsync.MappedRebuilderStream
A version of RebuilderStream
that maps large files to memory
using the NIO API. Small files are not mapped and automatically use
the superclass's implementation.
Field Summary | |
---|---|
static int |
MAP_LIMIT
The default lower bound for files to map. |
protected long |
mapLimit
The lower bound file length to map; files smaller than this will not be mapped. |
protected long |
mapOffset
The current offset in the file where the region is mapped. |
protected MappedByteBuffer |
mappedFile
The mapped file, if any. |
protected long |
mapSize
The size of the map. |
Fields inherited from class org.metastatic.rsync.RebuilderStream |
---|
basisFile, listeners |
Constructor Summary | |
---|---|
MappedRebuilderStream()
Create a new memory mapped rebuilder, with the default map limit and a maximum map size of Integer.MAX_VALUE . |
|
MappedRebuilderStream(long mapLimit)
Create a new memory mapped rebuilder with the given map limit and a maximum map size of Integer.MAX_VALUE . |
|
MappedRebuilderStream(long mapSize,
long mapLimit)
Create a new memory mapped rebuilder with the given map limit and maximum map size. |
Method Summary | |
---|---|
void |
setBasisFile(File file)
Set the basis file. |
void |
setBasisFile(String filename)
Set the basis file. |
void |
update(Delta delta)
Update this rebuilder with a delta. |
Methods inherited from class org.metastatic.rsync.RebuilderStream |
---|
addListener, doFinal, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAP_LIMIT
protected long mapSize
protected long mapLimit
protected MappedByteBuffer mappedFile
protected long mapOffset
Constructor Detail |
public MappedRebuilderStream()
Integer.MAX_VALUE
.
public MappedRebuilderStream(long mapLimit)
Integer.MAX_VALUE
.
mapLimit
- The smallest file size to map.public MappedRebuilderStream(long mapSize, long mapLimit)
mapSize
- The maximum size of map to create.mapLimit
- The smallest file size to map.Method Detail |
public void setBasisFile(File file) throws IOException
RebuilderStream
setBasisFile
in class RebuilderStream
file
- The basis file.
IOException
- If the file is not readable.public void setBasisFile(String filename) throws IOException
RebuilderStream
setBasisFile
in class RebuilderStream
filename
- The basis file name.
IOException
- If the file name is not the name of a readable file.public void update(Delta delta) throws IOException, ListenerException
RebuilderStream
update
in class RebuilderStream
delta
- The delta to apply.
IOException
- If there is an error reading from the basis
file, or if no basis file has been specified.
ListenerException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |