Package kotlin.streams

Utility functions for working with Java 8 streams.

Functions

asSequence
Link copied to clipboard
fun DoubleStream.asSequence(): Sequence<Double>
fun IntStream.asSequence(): Sequence<Int>
fun LongStream.asSequence(): Sequence<Long>
fun <T> Stream<T>.asSequence(): Sequence<T>

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

Since Kotlin

1.2
asStream
Link copied to clipboard
fun <T> Sequence<T>.asStream(): Stream<T>

Creates a sequential Stream instance that produces elements from the original sequence.

Since Kotlin

1.2
toList
Link copied to clipboard
fun DoubleStream.toList(): List<Double>
fun IntStream.toList(): List<Int>
fun LongStream.toList(): List<Long>
fun <T> Stream<T>.toList(): List<T>

Returns a List containing all elements produced by this stream.

Since Kotlin

1.2