to Byte Array
abstract suspend fun toByteArray(coroutineScope: CoroutineScope? = null, expectedSize: Long? = null, maxSize: Long? = null): ByteArray?
Creates a ByteArray and stores it into a cache for re-use.
Return
The loaded media as a ByteArray or null when maxSize was exceeded.
Parameters
coroutine Scope
The CoroutineScope is used to remove the ByteArray from cache when not used anymore. Otherwise, it is automatically removed after the media value defined in MatrixClientConfiguration.cacheExpireDurations.
expected Size
The size of the media propagated by e.g., events or null if not known.
max Size
The max size allowed loading into memory.