Package kotlinx.coroutines.experimental.io
Byte I/O channels (unstable, work in progress).
Types
interface ByteChannel : ByteReadChannel, ByteWriteChannel Channel for asynchronous reading and writing of sequences of bytes. This is a buffered single-reader single-writer channel. |
|
interface ByteReadChannel Channel for asynchronous reading of sequences of bytes. This is a single-reader channel. |
|
interface ByteWriteChannel Channel for asynchronous writing of sequences of bytes. This is a single-writer channel. |
|
interface LookAheadSession |
|
interface LookAheadSuspendSession : LookAheadSession |
|
interface ReaderJob : Job A coroutine job that is reading from a byte channel |
|
interface ReaderScope : CoroutineScope |
|
interface WriterJob : Job A coroutine job that is writing to a byte channel |
|
interface WriterScope : CoroutineScope |
|
interface WriterSession |
|
interface WriterSuspendSession : WriterSession |
Exceptions
class ClosedWriteChannelException : CancellationException Indicates attempt to write on isClosedForWrite channel that was closed without a cause. A failed channel rethrows the original close cause exception on send attempts. |
Type Aliases
typealias ByteBuffer = ByteBuffer Byte buffer. |
|
typealias ByteOrder = ByteOrder Byte order. |
|
typealias ConsumeEachBufferVisitor = (buffer: ByteBuffer, last: Boolean) -> Boolean |
Properties
val EmptyByteReadChannel: ByteReadChannel Byte channel that is always empty. |
Functions
fun ByteChannel(autoFlush: Boolean = false): ByteChannel Creates buffered channel for asynchronous reading and writing of sequences of bytes. |
|
fun ByteReadChannel(content: ByteBuffer): ByteReadChannel Creates channel for reading from the specified byte buffer. fun ByteReadChannel(content: ByteArray): ByteReadChannel Creates channel for reading from the specified byte array. |
|
fun LookAheadSession.consumeEachRemaining( |
|
suspend fun ByteReadChannel.copyAndClose( Reads all the bytes from receiver channel and writes them to dst channel and then closes it. Closes dst channel if fails to read or write with cause exception. |
|
suspend fun ByteReadChannel.copyTo( Reads up to limit bytes from receiver channel and writes them to dst channel. Closes dst channel if fails to read or write with cause exception. |
|
suspend fun ByteReadChannel.joinTo( |
|
suspend fun ByteReadChannel.readASCIILine( |
|
suspend fun ByteReadChannel. |
|
suspend fun ByteReadChannel.readRemaining( Reads all the bytes from receiver channel and builds a packet that is returned unless the specified limit exceeded. It will simply stop reading and return packet of size limit in this case |
|
suspend fun ByteReadChannel.readUTF8Line( |
|
suspend fun ByteReadChannel.readUntilDelimiter( Reads from the channel to the specified dst byte buffer until one of the following: |
|
fun reader( fun reader( |
|
suspend fun ByteReadChannel.skipDelimiter( |
|
suspend fun ByteWriteChannel. suspend fun ByteWriteChannel. |
|
suspend fun ByteWriteChannel.writeBoolean(b: Boolean): Unit |
|
suspend fun ByteWriteChannel.writeByte(b: Int): Unit |
|
suspend fun ByteWriteChannel.writeBytes(s: String): Unit |
|
suspend fun ByteWriteChannel.writeChar(ch: Char): Unit Writes UTF16 character |
|
suspend fun ByteWriteChannel.writeChars(s: String): Unit |
|
suspend fun ByteWriteChannel.writeInt(i: Long): Unit |
|
suspend fun ByteWriteChannel.writePacket( |
|
suspend fun ByteWriteChannel.writePacketSuspend( |
|
suspend fun ByteWriteChannel.writeShort(s: Int): Unit |
|
suspend fun ByteWriteChannel.writeStringUtf8( suspend fun ByteWriteChannel.writeStringUtf8( suspend fun ByteWriteChannel.writeStringUtf8(s: String): Unit |
|
suspend fun ByteWriteChannel. |
|
fun writer( fun writer( |