Skip to main content

FileDataSource

Fields

privateMeta

Declared private (to be encrypted) metadata of the File

var privateMeta:Data

publicMeta

Declared public metadata of the File

var publicMeta:Data

size

Declared size of the File

var size:Int64

hasDataLeft

Signifies that there are still bytes that have not been retrieved

var hasDataLeft:Bool

Methods

getNextChunk(ofSize:)

Retrieves up to chunkSizebytes from the data source.

mutating func getNextChunk(
ofSize chunkSize:Int64
) throws -> Data

NameTypeDescription
chunkSizeInt64the size of a chunk to retrieve from the source

TypeDescription
Data next `chunkSize` bytes from the source

close()

Attempts to close the data source. Calling this method makes sense if the source is a file on disc.

mutating func close(
) throws