ants.p2p.filesharing
Class PartialFile
java.lang.Object
ants.p2p.filesharing.PartialFile
public class PartialFile
- extends java.lang.Object
Constructor Summary |
PartialFile(java.lang.String name,
java.lang.String source,
byte[] hash,
boolean resume,
long offset,
FilePushMessage fpm,
java.beans.PropertyChangeSupport pcs)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lastId
public long lastId
PartialFile
public PartialFile(java.lang.String name,
java.lang.String source,
byte[] hash,
boolean resume,
long offset,
FilePushMessage fpm,
java.beans.PropertyChangeSupport pcs)
throws java.lang.Exception
- Throws:
java.lang.Exception
computeGroupFactor
public static int computeGroupFactor(int blockSize)
getLastId
public long getLastId()
getName
public java.lang.String getName()
getHash
public byte[] getHash()
getLastActivityTime
public long getLastActivityTime()
getFilePushMessage
public FilePushMessage getFilePushMessage()
appendBytes
public void appendBytes(byte[] b,
long id)
receivedBlock
public boolean receivedBlock()
finalizeFile
public void finalizeFile()
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
getReceivedSize
public long getReceivedSize()
compareHash
public static boolean compareHash(byte[] h1,
byte[] h2)