int moveTasksFromBuffers ( Task [ ] tasks ) { int maxTaskIndex = - 1 ; for ( int i = 0 ; i < buffers . length ; i ++ ) { int maxIndex = moveTasksFromBuffer ( tasks , i ) ; maxTaskIndex = Math . max ( maxIndex , maxTaskIndex ) ; } return maxTaskIndex ; }
Moves the tasks from the buffers into the output array .