The following function would be nice to have ByteReadChannel.readTo(sink: RawSink, byteCount: Long) [io.ktor.utils.io] It would allow to store directly into a file (instead of copying data inbetween so something like this @OptIn(InternalAPI::class) suspend fun ByteReadChannel.readTo(sink: RawSink, byteCount: Long) { var remaining = byteCount while (remaining > 0 && !isClosedForRead) { if (readBuffer.exhausted()) awaitContent() val size = minOf(remaining.toLong(), readBuffer.remaining) readBuffer.readTo(sink, size) remaining -= size.toInt() } } Not sure if it is working (not tested)