Package-level declarations
Types
An exception thrown when an IO error occurred during reading or writing to/from the underlying channel. The typical error is "connection reset" and so on.
An exception that is thrown when an IO error occurred during reading from the request channel. Usually it happens when a remote client closed the connection.
An exception that is thrown when an IO error occurred during writing to the destination channel. Usually it happens when a remote client closed the connection.
Functions
Open a buffered writer to the channel
Read data chunks from ByteReadChannel using buffer
Launch a coroutine to open a read channel for a file and fill it. Please note that file reading 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.
Launches a coroutine to open a read channel for a file and fill it. Please note that file reading 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.
Convert ByteReadChannel to ByteArray
Open a channel and launch a coroutine to copy bytes from the input stream to the channel. Please note that it may block your async code when started on Dispatchers.Unconfined since InputStream is blocking on it's nature
Executes block on ByteWriteChannel and close it down correctly whether an exception
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.
Open a writer to the channel