asSequence

JVM
JRE8
1.2
fun DoubleStream.asSequence(): Sequence<Double>
(source)

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 doubleStream: DoubleStream = DoubleStream.of(1e2, 1e3, 1e4)
val doubleSequence: Sequence<Double> = doubleStream.asSequence()
println(doubleSequence.joinToString(", ")) // 100.0, 1000.0, 10000.0
//sampleEnd
}