Here you can find the source of toStream(Iterable
Parameter | Description |
---|---|
iterable | iterable to convert into a stream |
public static <T> Stream<T> toStream(Iterable<T> iterable)
//package com.java2s; //License from project: Apache License import java.util.stream.Stream; import java.util.stream.StreamSupport; public class Main { /**//from w w w . j av a 2 s . c o m * Converts an iterable into a stream. * By default the stream cannot be parallelized. * @param iterable iterable to convert into a stream * @return stream */ public static <T> Stream<T> toStream(Iterable<T> iterable) { return StreamSupport.stream(iterable.spliterator(), false); } }