Answers for "kotlin read all bytes from inputstream"

2

kotlin read all bytes from 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 bytes from inputstream"

Browse Popular Code Answers by Language