Instance Method
copyBytes(to:from:)
iOS 8.0+
iPadOS 8.0+
Mac Catalyst 8.0+
macOS 10.10+
tvOS 9.0+
watchOS 2.0+
Copies the bytes from the given range to the destination buffer.
@discardableResult func copyBytes<DestinationType, R>(to: UnsafeMutableBufferPointer<DestinationType>, from: R) -> Int where R : RangeExpression, Self.Index == R.Bound
Parameters
toA typed pointer to the buffer you want to copy the bytes into.
fromThe range of bytes to copy.
Return Value
The number of bytes copied.
Discussion
A default implementation is given in terms of self.regions.
Default Implementations
DataProtocol Implementations
func copyBytes<DestinationType, R>(to: UnsafeMutableBufferPointer<DestinationType>, from: R)Copies a range of the bytes from the type into a typed memory buffer.func copyBytes<R>(to: UnsafeMutableRawBufferPointer, from: R) -> IntCopies a range of the bytes from the type into a raw memory buffer.func copyBytes<DestinationType, R>(to: UnsafeMutableBufferPointer<DestinationType>, from: R) -> IntCopies a range of the bytes from the type into a typed memory buffer.