Java Stream Operation infiniteParallelStream()

Here you can find the source of infiniteParallelStream()

Description

Creates an infinite parallel long stream.

License

Open Source License

Return

An infinite stream

Declaration

public static LongStream infiniteParallelStream() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.stream.LongStream;

import static java.util.stream.LongStream.iterate;

public class Main {
    /**/*from   w  w w.  java2  s. c  om*/
     * Creates an infinite parallel long stream.
     *
     * @return An infinite stream
     */
    public static LongStream infiniteParallelStream() {
        return iterate(1L, l -> l + 1).parallel();
    }
}

Related

  1. flattenFeatureStreamToMap( Stream>>> stream)
  2. gcd(IntStream numbers)
  3. getOSIllegalCharacterStream(String path)
  4. getStream(Iterable iterable)
  5. getStringStreamFromArray(String... ids)
  6. interleave(Stream a, Stream b)
  7. isEmpty(final Stream stream)
  8. isFinite(Stream stream)
  9. iterableOf(Stream stream)