---
title: "init(bytes:)"
framework: dispatch
role: symbol
role_heading: Initializer
path: "dispatch/dispatchdata/init(bytes:)-mkbp"
---

# init(bytes:)

Initialize a data object with copied memory content.

## Declaration

```swift
init(bytes buffer: UnsafeBufferPointer<UInt8>)
```

## Parameters

- `buffer`: A pointer to the memory. It will be copied.

## See Also

### Deprecated

- [init(bytesNoCopy:deallocator:)](dispatch/dispatchdata/init(bytesnocopy:deallocator:)-7h08w.md)
- [append(_:count:)](dispatch/dispatchdata/append(_:count:).md)
- [copyBytes(to:count:)](dispatch/dispatchdata/copybytes(to:count:)-4ffyj.md)
- [copyBytes(to:from:)](dispatch/dispatchdata/copybytes(to:from:)-6ztcb.md)
