LocalFile

interface LocalFile

Represents a file on the local machine that is being transferred within a DataBundle.

Properties

Link copied to clipboard
abstract val isClosed: Boolean

indicates whether the file can be read

Link copied to clipboard
abstract val lastModified: Measure<Time>

epoch time of the file

Link copied to clipboard
abstract val name: String

of the file

Link copied to clipboard
abstract val size: Measure<BinarySize>

of the file

Link copied to clipboard
abstract val type: String

mime-type of the file

Functions

Link copied to clipboard
abstract suspend fun read(progress: (Float) -> Unit = {}): ByteArray?

Reads the file contents as a ByteArray.

Link copied to clipboard
abstract suspend fun readBase64(progress: (Float) -> Unit = {}): String?

Reads the file contents as a base64 encoded String.

Link copied to clipboard
abstract suspend fun readText(encoding: String? = null, progress: (Float) -> Unit = {}): String?

Reads the file contents as a String.