diff --git a/app/src/main/java/eu/depau/etchdroid/massstorage/BlockDeviceOutputStream.kt b/app/src/main/java/eu/depau/etchdroid/massstorage/BlockDeviceOutputStream.kt index 8c83e39..f391ce4 100644 --- a/app/src/main/java/eu/depau/etchdroid/massstorage/BlockDeviceOutputStream.kt +++ b/app/src/main/java/eu/depau/etchdroid/massstorage/BlockDeviceOutputStream.kt @@ -9,7 +9,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.ClosedReceiveChannelException import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.withContext @@ -29,15 +28,6 @@ private fun BlockDeviceOutputStream.traceIo(msg: String) { if (TRACE_IO) println("OSTREAM: ${Thread.currentThread().name} time ${System.nanoTime()} pos $mCurrentOffset $msg") } -interface ISeekableStream { - fun seek(offset: Long): Long { - return runBlocking { seekAsync(offset) } - } - - suspend fun seekAsync(offset: Long): Long { - return seek(offset) - } -} class BlockDeviceOutputStream( private val blockDev: BlockDeviceDriver, diff --git a/app/src/main/java/eu/depau/etchdroid/massstorage/ISeekableStream.kt b/app/src/main/java/eu/depau/etchdroid/massstorage/ISeekableStream.kt new file mode 100644 index 0000000..16259ab --- /dev/null +++ b/app/src/main/java/eu/depau/etchdroid/massstorage/ISeekableStream.kt @@ -0,0 +1,13 @@ +package eu.depau.etchdroid.massstorage + +import kotlinx.coroutines.runBlocking + +interface ISeekableStream { + fun seek(offset: Long): Long { + return runBlocking { seekAsync(offset) } + } + + suspend fun seekAsync(offset: Long): Long { + return seek(offset) + } +} \ No newline at end of file