Generic Initializer

init(buffer:)

Creates a data buffer with copied memory content using a mutable buffer pointer.

Declaration

init<SourceType>(buffer: UnsafeMutableBufferPointer<SourceType>)

Parameters

buffer

A buffer pointer to copy. The size is calculated from SourceType and buffer.count.

See Also

Creating Populated Data

init()

Creates an empty data buffer.

init<S>(S)

Creates a new instance of a collection containing the elements of a sequence.

init<SourceType>(buffer: UnsafeBufferPointer<SourceType>)

Creates a data buffer with copied memory content using a buffer pointer.

init(bytes: UnsafeRawPointer, count: Int)

Creates data with copied memory content.

init(bytesNoCopy: UnsafeMutableRawPointer, count: Int, deallocator: Data.Deallocator)

Creates a data buffer with memory content without copying the bytes.

init(capacity: Int)

Creates an empty data buffer of a specified size.

init(count: Int)

Creates a new data buffer with the specified count of zeroed bytes.