asSequence
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 longStream: LongStream = LongStream.of(5_000_000_000, 6_000_000_000, 7_000_000_000)
val longSequence: Sequence<Long> = longStream.asSequence()
println(longSequence.joinToString(", ")) // 5000000000, 6000000000, 7000000000
//sampleEnd
}