Java 8 Streams Java Java API
java.util.stream.IntStream
LongStream mapToLong(IntToLongFunction mapper)
This intermediate operation returns a LongStream consisting of the results of applying the given mapper function to the elements of this stream.
LongStream
package com.logicbig.example.intstream;import java.util.stream.IntStream;import java.util.stream.LongStream;public class MapToLongExample { public static void main(String... args) { IntStream intStream = IntStream.range(1, 5); LongStream mapToLong = intStream.mapToLong(i -> (long) i + Integer.MAX_VALUE); mapToLong.forEach(System.out::println); }}
2147483648214748364921474836502147483651