---
title: "withUnsafeBytes(_:)"
framework: coremedia
role: symbol
role_heading: Instance Method
path: "coremedia/cmmutabledatablockbuffer/blockregion/withunsafebytes(_:)"
---

# withUnsafeBytes(_:)

Calls the given closure with a pointer to the underlying bytes of the region’s contiguous storage.

## Declaration

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