protected int advanceWriteIndex ( ) { int num = 0 , start = write_index ; for ( ; ; ) { if ( buf [ start ] == null ) break ; num ++ ; start = index ( start + 1 ) ; if ( start == tmp_write_index . get ( ) ) break ; } write_index = start ; return num ; }
Advance write_index up to tmp_write_index as long as no null msg is found