<!--
{
  "availability" : [
    "macOS: 15.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSMutableFileDataBuffer/withUnsafeMutableBytes(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "s:So23FSMutableFileDataBufferC5FSKitE22withUnsafeMutableBytesyxxSwq_YKXEq_YKs5ErrorR_r0_lF"
  },
  "title" : "withUnsafeMutableBytes(_:)"
}
-->

# withUnsafeMutableBytes(_:)

Performs the given closure with an unsafe pointer to the underlying bytes of the data buffer.

```
func withUnsafeMutableBytes<R, E>(_ body: (UnsafeMutableRawBufferPointer) throws(E) -> R) throws(E) -> R where E : Error
```

## Parameters

`body`

The closure to perform with the pointer.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)