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 chunkSize
bytes from the data source.
mutating func getNextChunk(
ofSize chunkSize:Int64
) throws -> Data
Name | Type | Description |
---|---|---|
chunkSize | Int64 | the size of a chunk to retrieve from the source |
Type | Description |
---|---|
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