Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.stream.Stream;
import java.util.stream.StreamSupport;

public class Main {
    /**
     * 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);
    }
}