File

open class File

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun close()

Closes the file.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
suspend fun flush()

Flushes any pending writes to the file.

Link copied to clipboard
suspend fun getLength(): Long

Returns the length of the file in bytes

Link copied to clipboard
suspend fun getProgress(): Long

Returns the sync progress of this file, that is, the total byte size of all the blocks of this file that's already been downloaded.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
suspend fun read(offset: Long, size: Long): ByteArray

Reads size bytes from the file starting at offset bytes from the beginning of the file.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
suspend fun truncate(len: Long)

Truncates the file to the given length.

Link copied to clipboard
suspend fun write(offset: Long, data: ByteArray)

Writes the data to the file at the given offset.