<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/OutputRawSpan/append(_:as:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s13OutputRawSpanV6append_2as_yx_xms9ByteOrderOts15BitwiseCopyableRzs18ConvertibleToBytesRzs17FixedWidthIntegerRzlF"
  },
  "title" : "append(_:as:_:)"
}
-->

# append(_:as:_:)

Appends the given value’s bytes to this span’s bytes.

```
mutating func append<T>(_ value: T, as type: T.Type, _ byteOrder: ByteOrder) where T : BitwiseCopyable, T : ConvertibleToBytes, T : FixedWidthInteger
```

## Parameters

`value`

The value to store as raw bytes.

`type`

The type of the instance to store.

`byteOrder`

The order in which the bytes will be encoded to the span.

## Discussion

There must be at least `MemoryLayout<T>.size` bytes available
in the span.

---

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)