Wrap with withContext

This commit is contained in:
Him188 2020-02-28 12:43:14 +08:00
parent c90013b23f
commit 50289924fe

View File

@ -148,7 +148,7 @@ suspend inline fun Input.suspendToExternalImage(): ExternalImage = withContext(I
suspend fun ByteReadChannel.toExternalImage(): ExternalImage {
val file = createTempFile().apply { deleteOnExit() }
file.outputStream().use {
this.copyTo(it)
withContext(IO) { copyTo(it) }
it.flush()
}