Answers for "kotlin read all inputstream"

2

kotlin read all inputstream

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()
Posted by: Guest on February-04-2021

Code answers related to "kotlin read all inputstream"

Browse Popular Code Answers by Language