Skip to content

Instance MethodFoundationEssentials

copyBytes(to:count:)

iOS 8.0+ iPadOS 8.0+ Mac Catalyst 8.0+ macOS 10.10+ tvOS 9.0+ watchOS 2.0+
Copies the contents of the data to memory.
func copyBytes(to pointer: UnsafeMutablePointer<UInt8>, count: Int)

Parameters

pointer

A pointer to the buffer you wish to copy the bytes into.

count

The number of bytes to copy.

Discussion

Warning

This method does not verify that the contents at pointer have enough space to hold count bytes.