PrivMX DOCS
API Reference/PrivMX Endpoint Swift Extra/Inboxes

BufferDataSource

FileDataSource using an internal Data buffer

Fields

privateMeta

Data Declared private (to be encrypted) metadata of the File

publicMeta

Data Declared public metadata of the File

size

Int64 Declared size of the File

hasDataLeft

Bool Signifies that there are still bytes that have not been retrieved

Methods

init(buffer:privateMeta:publicMeta:size:)

Params

buffer

Data

privateMeta

Data

publicMeta

Data

size

Int64

public init(
buffer: Data,
privateMeta: Data,
publicMeta: Data,
size: Int64
)

getNextChunk(ofSize:)

Advances the internal buffer by chunkSize bytes.

Params

chunkSize

Int64

amount of bytes to be retrieved

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

Returns

Data · First chunkSize bytes of the Internal buffer

close()

This method does nothing

public func close() throws

We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.