package Ġkom mon Ċ Ċ import Ġkotlinx . c interop .* Ċ import Ġplatform . Foundation .* Ċ Ċ fun Ġread Resource ( resourceName : ĠString ): ĠByteArray Ġ{ ĊĠĠĠ Ġval ĠfilePath Ġ= ĠNS Bundle . main Bundle . path For Resource ( resourceName , Ġof Type Ġ= Ġnull ) ĊĊĠĠĠ Ġval Ġfile Data Ġ= ĠNS Data . data With Contents Of File ( filePath !! ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠError (" failed Ġreading Ġresource Ġ$ resourceName ") ĊĊĠĠĠ Ġreturn Ġfile Data . bytes !!. read Bytes ( file Data . length . toInt ()) Ċ } ĊĊ