Example usage for java.util.stream IntStream mapToLong

List of usage examples for java.util.stream IntStream mapToLong

Introduction

In this page you can find the example usage for java.util.stream IntStream mapToLong.

Prototype

LongStream mapToLong(IntToLongFunction mapper);

Source Link

Document

Returns a LongStream consisting of the results of applying the given function to the elements of this stream.

Usage

From source file:Main.java

public static void main(String[] args) {
    IntStream i = IntStream.of(6, 5, 7, 1, 2, 3, 3);
    LongStream d = i.mapToLong(n -> {
        return (long) n;
    });/*from   w w w.ja  va  2 s  .c  om*/
    d.forEach(System.out::println);
}