Instance Method

get​Bytes(_:​)

Copies a data object’s contents into a given buffer.

Declaration

func getBytes(_ buffer: UnsafeMutableRawPointer)

Parameters

buffer

A buffer into which to copy the receiver's data. The buffer must be at least length bytes.

Discussion

You can see a sample using this method in Working With Binary Data.

See Also

Related Symbols

var bytes:​ Unsafe​Raw​Pointer

A pointer to the receiver’s contents.

func get​Bytes(Unsafe​Mutable​Raw​Pointer, range:​ NSRange)

Copies a range of bytes from the receiver’s data into a given buffer.

var description:​ String

A string that contains a hexadecimal representation of the object’s contents in a property list format.

func get​Bytes(Unsafe​Mutable​Raw​Pointer, length:​ Int)

Copies a number of bytes from the start of the receiver's data into a given buffer.