List < T > toList ( ) { List < T > items = new ArrayList <> ( data . length ( ) ) ; for ( int i = 0 ; i < data . length ( ) ; ++ i ) { T item = data . get ( i ) ; if ( item != null ) { items . add ( item ) ; } } return items ; }
Return a list with a copy of the data in the buffer .