mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-11-15 11:30:25 +00:00
MPPFile
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package dev.inmo.micro_utils.common
|
||||
|
||||
import dev.inmo.micro_utils.coroutines.doInIO
|
||||
import dev.inmo.micro_utils.coroutines.doOutsideOfCoroutine
|
||||
import java.io.File
|
||||
|
||||
actual typealias MPPFile = File
|
||||
|
||||
actual val MPPFile.filename: FileName
|
||||
get() = FileName(name)
|
||||
actual val MPPFile.filesize: Long
|
||||
get() = length()
|
||||
actual val MPPFile.bytesAllocator: SuspendByteArrayAllocator
|
||||
get() = {
|
||||
doInIO {
|
||||
doOutsideOfCoroutine {
|
||||
readBytes()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user