Stream from Iterable

Brian Goetz brian.goetz at oracle.com
Tue Dec 11 06:29:20 PST 2012


Try this:

Streams.stream(Streams.spliterator(iter.iterator(), sizeIfKnown),
                flags);

You might want ORDERED as a flag.

On 12/11/2012 1:07 AM, François Sarradin wrote:
> Hi,
>
> Is there a way to get a Stream from an Iterable with the update b67?
>
> Should I create a Collection first or is there something shorter?
>
> Regards,
> François Sarradin
>


More information about the lambda-dev mailing list