---
title: "withUnsafeBytes(_:)"
framework: coreml
role: symbol
role_heading: Instance Method
path: "coreml/mlmultiarray/withunsafebytes(_:)"
---

# withUnsafeBytes(_:)

Calls a given closure with a raw pointer to the multiarray’s storage.

## Declaration

```swift
func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R
```

## Parameters

- `body`: A closure with an doc://com.apple.documentation/documentation/Swift/UnsafeRawBufferPointer parameter that points to the storage for the multiarray. This closure takes the following parameter:

## See Also

### Providing buffer access

- [withUnsafeBufferPointer(ofType:_:)](coreml/mlmultiarray/withunsafebufferpointer(oftype:_:).md)
- [withUnsafeMutableBufferPointer(ofType:_:)](coreml/mlmultiarray/withunsafemutablebufferpointer(oftype:_:).md)
- [withUnsafeMutableBytes(_:)](coreml/mlmultiarray/withunsafemutablebytes(_:).md)
