write

abstract suspend fun write(data: ByteArray)

Writes all bytes in data to the L2CAP channel and flushes it.

Throws

IOException

if writing to the channel fails.

CancellationException

if the coroutine is cancelled.