Spikey Sanju
11/09/2020, 1:27 PMIgor Demin
11/09/2020, 1:41 PMSpikey Sanju
11/09/2020, 1:41 PMSpikey Sanju
11/09/2020, 1:42 PMIgor Demin
11/09/2020, 1:52 PMprivate fun loadResource(path: String): ByteArray {
val resource = Thread.currentThread().contextClassLoader.getResource(path)
requireNotNull(resource) { "Resource $path not found" }
return resource.readBytes()
}
If multiplatform - we can't load resources in "common" sourceSet.
But we can load them in android sourceSet with ContextAmbient.current.
And in desktop sourceSet with getResource