android-components / mozilla.components.concept.fetch / Response / Body / useStream

useStream

fun <R> useStream(block: (InputStream) -> R): R (source)

Creates a usable stream from this body.

Executes the given block function with the stream as parameter and then closes it down correctly whether an exception is thrown or not.