def setBlockCompleted(pieceIndex, blockOffset, bool, clearRequested = :clear_requested)
      bi = blockIndexFromPieceAndOffset(pieceIndex, blockOffset)
      @requestedBlocks.clear bi if clearRequested == :clear_requested
      if bool
        @completeBlocks.set bi
        if allBlocksInPieceCompleted?(pieceIndex)
          yield pieceIndex if block_given?
          @completePieces.set pieceIndex
        end
      else
        @completeBlocks.clear bi
        @completePieces.clear pieceIndex
      end
    end
def setBlockCompleted(pieceIndex, blockOffset, bool, clearRequested = :clear_requested)
      bi = blockIndexFromPieceAndOffset(pieceIndex, blockOffset)
      @requestedBlocks.clear bi if clearRequested == :clear_requested
      if bool
        @completeBlocks.set bi
        if allBlocksInPieceCompleted?(pieceIndex)
          yield pieceIndex if block_given?
          @completePieces.set pieceIndex
        end
      else
        @completeBlocks.clear bi
        @completePieces.clear pieceIndex
      end
    end
Mark a block as completed. If clearRequested is :clear_requested, then the block is also marked
 as no longer requested. If this block completes the piece and a block is passed, the pieceIndex
 is yielded to the block.