All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jsCommon.io.nacular.doodle.datatransport.SimpleFile.kt Maven / Gradle / Ivy

There is a newer version: 0.10.2
Show newest version
package io.nacular.doodle.datatransport

import io.nacular.doodle.dom.ArrayBuffer
import io.nacular.doodle.dom.File
import io.nacular.doodle.dom.FileReader
import io.nacular.doodle.dom.Uint8Array
import io.nacular.doodle.dom.get
import io.nacular.doodle.dom.toDouble
import io.nacular.measured.units.BinarySize
import io.nacular.measured.units.BinarySize.Companion.bytes
import io.nacular.measured.units.Measure
import io.nacular.measured.units.Time
import io.nacular.measured.units.Time.Companion.milliseconds
import io.nacular.measured.units.times
import kotlin.coroutines.cancellation.CancellationException
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine

/**
 * Created by Nicholas Eddy on 12/28/21.
 */
internal actual class SimpleFile actual constructor(private val delegate: File): LocalFile {
    override val name        : String              get() = delegate.name
    override val size        : Measure get() = delegate.size.toDouble() * bytes
    override val type        : String              get() = delegate.type
    override val isClosed    : Boolean             get() = delegate.isClosed
    override val lastModified: Measure




© 2015 - 2024 Weber Informatics LLC | Privacy Policy