Instance MethodFoundationEssentials
copyBytes(to:from:)
iOS 8.0+
iPadOS 8.0+
Mac Catalyst 8.0+
macOS 10.10+
tvOS 9.0+
watchOS 2.0+
Copies a range of the bytes from the type into a raw memory buffer.
@discardableResult func copyBytes<R>(to ptr: UnsafeMutableRawBufferPointer, from range: R) -> Int where R : RangeExpression, Self.Index == R.Bound
Parameters
ptrA pointer to the raw memory buffer you want to copy the bytes into.
rangeThe range of bytes to copy.
Return Value
The number of bytes copied.