---
title: "load(fromByteOffset: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/load(frombyteoffset:as:)"
---

# load(fromByteOffset:as:)

Returns a value constructed from the raw memory at the specified offset.

## Declaration

```swift
func load<T>(fromByteOffset offset: Int, as type: T.Type) -> T where T : ConvertibleFromBytes
```

## Parameters

- `offset`: The offset from the beginning of this span, in bytes. offset must be nonnegative.
- `type`: The type of the instance to create.

## Return Value

Return Value A new value of type T, read from offset.

## Discussion

Discussion The range of bytes required to construct a value of type T starting at offset must be completely within the span. offset is not required to be aligned for T.
