toList

JVM
JRE8
1.2
fun IntStream.toList(): List<Int>

Returns a List containing all elements produced by this stream.

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

fun main(args: Array<String>) {
//sampleStart
val intStream: IntStream = IntStream.of(10, 20, 30)
val intList: List<Int> = intStream.toList()
println(intList) // [10, 20, 30]
//sampleEnd
}