File tree Expand file tree Collapse file tree
kopus/src/androidAndJvmMain/kotlin/eu/buney/kopus Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ composeCharts = "0.2.0"
44kopus = " 1.6"
55kotlin = " 2.3.0"
66android-compileSdk = " 36"
7- android-minSdk = " 24 "
7+ android-minSdk = " 26 "
88android-targetSdk = " 36"
99coreKtx = " 1.17.0"
1010junit = " 4.13.2"
Original file line number Diff line number Diff line change 66 */
77package eu.buney.kopus
88
9- import java.io.File
9+ import java.nio.file.Path
1010import java.util.concurrent.atomic.AtomicBoolean
11+ import kotlin.io.path.createTempFile
12+ import kotlin.io.path.outputStream
1113
1214/* *
1315 * Handles loading of the Opus JNI native library.
@@ -51,15 +53,14 @@ object OpusLoader {
5153
5254 val resourcePath = " /native/$osPath /$archPath /$libName "
5355 val extracted = extractToTemp(resourcePath)
54- System .load(extracted.absolutePath )
56+ System .load(extracted.toAbsolutePath().toString() )
5557 }
5658
57- private fun extractToTemp (path : String ): File {
59+ private fun extractToTemp (path : String ): Path {
5860 val temp = createTempFile(" libopus_jni" )
5961 OpusLoader ::class .java.getResourceAsStream(path)?.use { input ->
6062 temp.outputStream().use { output -> input.copyTo(output) }
6163 } ? : throw RuntimeException (" Could not find $path in resources!" )
62- temp.deleteOnExit()
6364 return temp
6465 }
6566}
You can’t perform that action at this time.
0 commit comments