---
title: "replaceUnsafeMutableBytes(_:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelbuffer/replaceunsafemutablebytes(_:)"
---

# replaceUnsafeMutableBytes(_:)

Replace the buffer’s contents synchronously on the CPU.

## Declaration

```swift
final func replaceUnsafeMutableBytes(_ callback: (UnsafeMutableRawBufferPointer) -> Void)
```

## Discussion

Discussion The buffer’s contents are unspecified, and it is the caller’s responsibility to populate the buffer with valid data. The buffer provided is only valid for the lifetime of the callback.
