|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.downloader.VerifyingFile
All the HTTPDownloaders associated with a ManagedDownloader will commit the parts of the file they are downloading through a single object of this class.
Keeps track of which bytes have already been written to disk, and based on this information makes a decision about whether or not to do checking.
Users of this class must call open(...) before calling writeBlock.
Constructor Summary | |
VerifyingFile(boolean checkOverlap)
|
Method Summary | |
void |
addInterval(Interval interval)
used to add blocks direcly. |
void |
clearManagedDownloader()
Clears the ManagedDownloader variable, allowing it to be GC'ed. |
void |
close()
Closes the file output stream. |
java.util.Iterator |
getBlocks()
|
java.util.List |
getBlocksAsList()
|
int |
getBlockSize()
|
java.util.Iterator |
getFreeBlocks(int maxSize)
|
ManagedDownloader |
getManagedDownloader()
Returns the ManagedDownloader this VerifyingFile is associated with. |
boolean |
isCorrupted()
Returns whether or not we have determined if the written is corrupted. |
void |
open(java.io.File file,
ManagedDownloader md)
|
void |
writeBlock(long currPos,
int numBytes,
byte[] buf)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VerifyingFile(boolean checkOverlap)
Method Detail |
public void open(java.io.File file, ManagedDownloader md) throws java.io.IOException
java.io.IOException
public void addInterval(Interval interval)
public void writeBlock(long currPos, int numBytes, byte[] buf) throws java.io.IOException
java.io.IOException
public java.util.Iterator getBlocks()
public java.util.List getBlocksAsList()
public java.util.Iterator getFreeBlocks(int maxSize)
public int getBlockSize()
public void close()
public void clearManagedDownloader()
public boolean isCorrupted()
public ManagedDownloader getManagedDownloader()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |