toList

JVM
JRE8
1.2
fun LongStream.toList(): List<Long>
(source)

Returns a List containing all elements produced by this stream.

import java.util.stream.*
import kotlin.streams.*

fun main(args: Array<String>) {
//sampleStart
val longStream: LongStream = LongStream.of(3_000_000_000, 4_000_000_000, 5_000_000_000)
val longList: List<Long> = longStream.toList()
println(longList) // [3000000000, 4000000000, 5000000000]
//sampleEnd
}