ants.p2p.filesharing
Class PartialFile

java.lang.Object
  extended by ants.p2p.filesharing.PartialFile

public class PartialFile
extends java.lang.Object


Field Summary
 long lastId
           
 
Constructor Summary
PartialFile(java.lang.String name, java.lang.String source, byte[] hash, boolean resume, long offset, FilePushMessage fpm, java.beans.PropertyChangeSupport pcs)
           
 
Method Summary
 void appendBytes(byte[] b, long id)
           
static boolean compareHash(byte[] h1, byte[] h2)
           
static int computeGroupFactor(int blockSize)
           
 boolean equals(java.lang.Object o)
           
 void finalizeFile()
           
 FilePushMessage getFilePushMessage()
           
 byte[] getHash()
           
 long getLastActivityTime()
           
 long getLastId()
           
 java.lang.String getName()
           
 long getReceivedSize()
           
 boolean receivedBlock()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastId

public long lastId
Constructor Detail

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
Method Detail

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)