---
title: "storeBytes(of:toByteOffset:as:)"
framework: Swift
role: symbol
role_heading: Instance Method
platforms: [iOS 12.2+, iPadOS 12.2+, Mac Catalyst 12.2+, macOS 10.14.4+, tvOS 12.2+, visionOS 1.0+, watchOS 5.2+]
path: "swift/mutablerawspan/storebytes(of:tobyteoffset:as:)-37pwo"
---

# storeBytes(of:toByteOffset:as:)

Stores the given value’s bytes into the span’s raw memory at the specified byte offset.

## Declaration

```swift
mutating func storeBytes<T>(of value: T, toByteOffset offset: Int = 0, as type: T.Type) where T : BitwiseCopyable
```

## Parameters

- `value`: The value to store as raw bytes.
- `offset`: The offset from the start of the span, in bytes. offset must be nonnegative. The default is zero.
- `type`: The type of value.
