예제 #1
0
 public synchronized void add_block(int pieceIndex, int offset, int size, byte[] b) {
   Piece p = this.pieces.get(pieceIndex);
   p.writeBlock(b, offset);
   if (p.haveAllBlocks() == 1) {
     this.finished_pieces[pieceIndex] = true;
     // System.out.println("verified");
   }
   return;
 }