mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-06-30 21:37:36 +00:00
11 lines
265 B
Kotlin
11 lines
265 B
Kotlin
|
package dev.inmo.micro_utils.coroutines
|
||
|
|
||
|
import kotlinx.coroutines.await
|
||
|
import org.khronos.webgl.Int8Array
|
||
|
import org.w3c.fetch.Response
|
||
|
import org.w3c.files.Blob
|
||
|
|
||
|
suspend fun Blob.toByteArray() = Int8Array(
|
||
|
Response(this).arrayBuffer().await()
|
||
|
) as ByteArray
|