Exemplo n.º 1
0
 /**
  * specifies if this piece is part of the read cache or the write cache.
  *
  * @return
  */
 public Kind getKind() {
   return Kind.fromSwig(i.getKind().swigValue());
 }
Exemplo n.º 2
0
 /**
  * The index of the next block that needs to be hashed. Blocks are hashed as they are downloaded
  * in order to not have to re-read them from disk once the piece is complete, to compare its hash
  * against the hashes in the .torrent file.
  *
  * @return
  */
 public int getNextToHash() {
   return i.getNext_to_hash();
 }
Exemplo n.º 3
0
 /**
  * holds one entry for each block in this piece. ``true`` represents the data for that block being
  * in the disk cache and ``false`` means it's not.
  *
  * @return
  */
 public boolean[] getBlocks() {
   return Vectors.bool_vector2booleans(i.getBlocks());
 }
Exemplo n.º 4
0
 /**
  * the time when a block was last written to this piece. The older a piece is, the more likely it
  * is to be flushed to disk.
  *
  * @return
  */
 public PTime getLastUse() {
   return new PTime(i.getLast_use());
 }
Exemplo n.º 5
0
 /**
  * the piece index for this cache entry.
  *
  * @return
  */
 public int getPiece() {
   return i.getPiece();
 }