Kotlin Read All Bytes From Inputstream

[Solved] Kotlin Read All Bytes From Inputstream | Kotlin - Code Explorer | yomemimo.com
Question : kotlin read all bytes from inputstream

Answered by : dan

val ins: InputStream;
// both close stream after use
val text = ins.bufferedReader().use { it.readText() }
val text = ins.reader().use { it.readText() }
// doesn't close stream after use
val text = ins.reader().readText()

Source : | Last Update : Thu, 11 Feb 21

Answers related to kotlin read all bytes from inputstream

Code Explorer Popular Question For Kotlin