withUnsafeBytes(_:)

Calls the given closure with a pointer to a copy of the underlying bytes of the array’s storage.

JSTypedArray.swift:83
func withUnsafeBytes<R>(_ body: (UnsafeBufferPointer<Element>) throws -> R) rethrows -> R

Parameters

body

A closure with an UnsafeBufferPointer parameter that points to the contiguous storage for the array. If body has a return value, that value is also used as the return value for the withUnsafeBytes(_:) method. The argument is valid only for the duration of the closure’s execution.

Returns

The return value, if any, of the body closure parameter.