onCompletion

abstract fun onCompletion(data: ByteArray?, errorMessage: String?)

Invoked when the read operation is complete.

Parameters

data

The data read from the external channel, or null if no data was available.

errorMessage

An optional error message; set if the read operation failed, or null if it succeeded.