File

class File

A File stored in a Ouisync repository.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun close(): Any?

Closes the file.

Link copied to clipboard
suspend fun flush(): Any?

Flushes any pending writes to the file.

Link copied to clipboard
suspend fun length(): Long

Returns the length of this file in bytes

Link copied to clipboard
suspend fun progress(): 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
suspend fun read(offset: Long, length: Long): ByteArray

Reads the given amount of bytes from this file, starting at the given offset.

Link copied to clipboard
suspend fun truncate(length: Long): Any?

Truncates the file to the given length.

Link copied to clipboard
suspend fun write(offset: Long, array: ByteArray): Any?

Writes the content of the array to the file at the given offset.