consumeAsFlow

fun <T> Stream<T>.consumeAsFlow(): <Error class: unknown class><T>

Represents the given stream as a flow and closes the stream afterwards. The resulting flow can be Flow.collect only once and throws IllegalStateException when trying to collect it more than once.