@ Override public Stream < T > queued ( int queueSize ) { final Iterator < T > iter = iterator ( ) ; if ( iter instanceof QueuedIterator && ( ( QueuedIterator < ? extends T > ) iter ) . max ( ) >= queueSize ) { return newStream ( elements , sorted , cmp ) ; } else { return newStream ( Stream . parallelConcatt ( Arrays . asList ( iter ) , 1 , queueSize ) , sorted , cmp ) ; } }
Returns a Stream with elements from a temporary queue which is filled by reading the elements from the specified iterator asynchronously .