withUnsafeBytes

func withUnsafeBytes(of:_:)(of value: inout T, _ body: (UnsafeRawBufferPointer) throws -> Result) rethrows -> Result

Invokes the given closure with a buffer pointer covering the raw bytes of the given argument.

The buffer pointer argument to the body closure provides a collection interface to the raw bytes of value. The buffer is the size of the instance passed as value and does not include any remote storage.

func withUnsafeBytes(of:_:)(of value: T, _ body: (UnsafeRawBufferPointer) throws -> Result) rethrows -> Result

Invokes the given closure with a buffer pointer covering the raw bytes of the given argument.

The buffer pointer argument to the body closure provides a collection interface to the raw bytes of value. The buffer is the size of the instance passed as value and does not include any remote storage.