Repository: JetBrains/compose-multiplatform
File: components/resources/library/src/androidMain/kotlin/org/jetbrains/compose/resources/ResourceReader.android.kt (Kotlin)

Code before:
package org.jetbrains.compose.resources

import android.content.res.AssetManager
import android.net.Uri
import android.util.Log
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ProvidableCompositionLocal
import java.io.FileNotFoundException
import java.io.InputStream

@ExperimentalResourceApi
internal actual fun getPlatformResourceReader(): ResourceReader = DefaultAndroidResourceReader

@ExperimentalResourceApi
internal object DefaultAndroidResourceReader : ResourceReader {
    private val assets: AssetManager by lazy {
        val context = androidContext ?: error(
            "Android context is not initialized. " +
                    "If it happens in the Preview mode then call PreviewContextConfigurationEffect() function."
        )
        context.assets
    }

    private val instrumentedAssets: AssetManager?
        get() = try {
            androidInstrumentedContext.assets
        } catch (e: NoClassDefFoundError) {
            Log.d("ResourceReader", "Android Instrumentation context is not available.")
            null
        }

    override suspend fun read(path: String): ByteArray {
        val resource = getResourceAsStream(path)
        return resource.use { input -> input.readBytes() }
    }

    override suspend fun readPart(path: String, offset: Long, size: Long): ByteArray {
        val resource = getResourceAsStream(path)
        val result = ByteArray(size.toInt())
        resource.use { input ->
            input.skipBytes(offset)

Review comment (suggestion):
It looks like, it shouldn't compile after you made it nullable?
```
override fun getUri(path: String): String {
        val uri = if (assets.hasFile(path) || instrumentedAssets.hasFile(path)) {
```

Code after:
package org.jetbrains.compose.resources

import android.content.res.AssetManager
import android.net.Uri
import android.util.Log
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ProvidableCompositionLocal
import java.io.FileNotFoundException
import java.io.InputStream

@ExperimentalResourceApi
internal actual fun getPlatformResourceReader(): ResourceReader = DefaultAndroidResourceReader

@ExperimentalResourceApi
internal object DefaultAndroidResourceReader : ResourceReader {
    private val assets: AssetManager? get() = androidContext?.assets

    private val instrumentedAssets: AssetManager?
        get() = try {
            androidInstrumentedContext.assets
        } catch (e: NoClassDefFoundError) {
            Log.d("ResourceReader", "Android Instrumentation context is not available.")
            null
        }

    override suspend fun read(path: String): ByteArray {
        val resource = getResourceAsStream(path)
        return resource.use { input -> input.readBytes() }
    }

    override suspend fun readPart(path: String, offset: Long, size: Long): ByteArray {
        val resource = getResourceAsStream(path)
        val result = ByteArray(size.toInt())
        resource.use { input ->
            input.skipBytes(offset)
            input.readBytes(result, 0, size.toInt())
        }
        return result
    }

    //skipNBytes requires API 34