<!--
{
  "availability" : [
    "iOS: 12.2.0 -",
    "iPadOS: 12.2.0 -",
    "macCatalyst: 12.2.0 -",
    "macOS: 10.14.4 -",
    "tvOS: 12.2.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/MutableRawSpan/storeBytes(of:toUncheckedByteOffset:as:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s14MutableRawSpanV10storeBytes2of21toUncheckedByteOffset2asyx_Sixmts15BitwiseCopyableRzlF"
  },
  "title" : "storeBytes(of:toUncheckedByteOffset:as:)"
}
-->

# storeBytes(of:toUncheckedByteOffset:as:)

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

```
mutating func storeBytes<T>(of value: T, toUncheckedByteOffset offset: Int, 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.

`type`

The type of `value`.

## Discussion

This function does not validate `offset`; this is an unsafe operation.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)