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

# init(bytes:)

Creates a new dispatch data object from the specified memory buffer.

## Declaration

```swift
init(bytes buffer: UnsafeRawBufferPointer)
```

## Parameters

- `buffer`: A contiguous buffer of memory containing the initial data.

## See Also

### Creating a Dispatch Data Structure

- [init(bytesNoCopy:deallocator:)](dispatch/dispatchdata/init(bytesnocopy:deallocator:)-vfoe.md)
- [withUnsafeBytes(body:)](dispatch/dispatchdata/withunsafebytes(body:).md)
- [DispatchData.Deallocator](dispatch/dispatchdata/deallocator.md)
- [empty](dispatch/dispatchdata/empty.md)
