Skip to main content

BufferDataSource

FileDataSource using an internal Data buffer

Fields

privateMeta

Declared private (to be encrypted) metadata of the File

public let privateMeta: Data

publicMeta

Declared public metadata of the File

public let publicMeta: Data

size

Declared size of the File

public let size: Int64

hasDataLeft

Signifies that there are still bytes that have not been retrieved

public var hasDataLeft: Bool

Methods

init(buffer:privateMeta:publicMeta:size:)

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

NameTypeDescription
bufferData
privateMetaData
publicMetaData
sizeInt64

getNextChunk(ofSize:)

Advances the internal buffer by chunkSize bytes.

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

NameTypeDescription
chunkSizeInt64amount of bytes to be retrieved

TypeDescription
Data First `chunkSize` bytes of the Internal buffer

close()

This method does nothing

public func close() throws