Initializer

init(bytes:length:)

Returns a data object initialized by adding to it a given number of bytes of data copied from a given buffer.

Declaration

init(bytes: UnsafeRawPointer?, length: Int)

Discussion

A data object initialized by adding to it length bytes of data copied from the buffer bytes. The returned object might be different than the original receiver.

See Also

Related Symbols

init(bytesNoCopy: UnsafeMutableRawPointer, length: Int)

Returns a data object initialized by adding to it a given number of bytes of data from a given buffer.

init(bytesNoCopy: UnsafeMutableRawPointer, length: Int, freeWhenDone: Bool)

Initializes a newly allocated data object by adding to it length bytes of data from the buffer bytes.

dataWithBytes:length:

Creates and returns a data object containing a given number of bytes copied from a given buffer.