Example usage for java.util.stream LongStream flatMap

List of usage examples for java.util.stream LongStream flatMap

Introduction

In this page you can find the example usage for java.util.stream LongStream flatMap.

Prototype

LongStream flatMap(LongFunction<? extends LongStream> mapper);

Source Link

Document

Returns a stream consisting of the results of replacing each element of this stream with the contents of a mapped stream produced by applying the provided mapping function to each element.

Usage

From source file:Main.java

public static void main(String[] args) {
    LongStream b = LongStream.of(1L, 2L, Long.MAX_VALUE, Long.MIN_VALUE);

    b.flatMap(n -> LongStream.of(n)).forEach(System.out::println);
}