---
title: "init(buffer:initializedCount:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/outputrawspan/init(buffer:initializedcount:)-1vcj6"
---

# init(buffer:initializedCount:)

Unsafely create an OutputRawSpan over partly-initialized memory.

## Declaration

```swift
init(buffer: UnsafeMutableRawBufferPointer, initializedCount: Int)
```

## Parameters

- `buffer`: An UnsafeMutableRawBufferPointer to be initialized
- `initializedCount`: The number of initialized bytes at the beginning of buffer.

## Discussion

Discussion The memory in buffer must remain valid throughout the lifetime of the newly-created OutputRawSpan. Its prefix must contain initializedCount initialized bytes, followed by uninitialized memory.
