load(fromByteOffset:as:)
Returns a value constructed from the raw memory at the specified offset.
Declaration
func load<T>(fromByteOffset offset: Int, as type: T.Type) -> T where T : ConvertibleFromBytesParameters
- offset:
The offset from the beginning of this span, in bytes.
offsetmust be nonnegative. - type:
The type of the instance to create.
Return Value
A new value of type T, read from offset.
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.