toByteArray

open suspend override fun toByteArray(): ByteArray

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.