ByteArrayBinaryData
class ByteArrayBinaryData(data: ByteArray, offset: Int = 0, length: Int = data.size - offset) : RpcBinaryData
RpcBinaryData backed by an in-memory ByteArray. Avoids all streaming and coroutine overhead — transferTo delivers the entire buffer in a single callback, and toByteArray returns the array directly.
Properties
Functions
Link copied to clipboard
Drain this source into a single ByteArray. Default implementation accumulates transferTo chunks; subclasses that already hold the data in memory should override this to return it directly.
Link copied to clipboard
open suspend override fun transferTo(sink: suspend (bytes: ByteArray, offset: Int, length: Int) -> Unit)