asSequence

JVM
JRE8
1.2
fun IntStream.asSequence(): Sequence<Int>

Creates a Sequence instance that wraps the original stream iterating through its elements.

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

fun main(args: Array<String>) {
//sampleStart
val intStream: IntStream = IntStream.of(5, 6, 7)
val intSequence: Sequence<Int> = intStream.asSequence()
println(intSequence.joinToString(", ")) // 5, 6, 7
//sampleEnd
}