writeChannel

fun File.writeChannel(
    pool: ObjectPool<ByteBuffer>
): ByteWriteChannel

Deprecated: Pool is not required here anymore so use writeChannel without specifying a pool.

Open a write channel for file and launch a coroutine to read from it. The coroutine is launched on Dispatchers.IO.

@JvmName("writeChannel$default") fun File.writeChannel(
    pool: ObjectPool<ByteBuffer>,
    mask: Int,
    something: Any?
): ByteWriteChannel

Deprecated: Binary compatibility.

fun File.writeChannel(
    coroutineContext: <ERROR CLASS> = Dispatchers.IO
): ByteWriteChannel

Open a write channel for the file and launch a coroutine to read from it. Please note that file writing is blocking so if you are starting it on Dispatchers.Unconfined it may block your async code and freeze the whole application when runs on a pool that is not intended for blocking operations. This is why coroutineContext should have Dispatchers.IO or a coroutine dispatcher that is properly configured for blocking IO.