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