Kotlin Flows and File IO
I have a Flow which I need to append into a File. My naive approach would be:
File(fileame).bufferedWriter().use { writer ->
withContext(IO) {
requests.collect {
writer.write(it.fileChunk.content.toStringUtf8())
}
}
}
Unfortuntately, IntelliJ marks the "write" as "blocking". What is the right way of achieving what I want? Thanks!