---
title: "append(_:length:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutabledata/append(_:length:)"
---

# append(_:length:)

Appends to the receiver a given number of bytes from a given buffer.

## Declaration

```swift
func append(_ bytes: UnsafeRawPointer, length: Int)
```

## Parameters

- `bytes`: A buffer containing data to append to the receiver’s content.
- `length`: The number of bytes from bytes to append.

## Discussion

Discussion A sample using this method can be found in Working With Mutable Binary Data.

## See Also

### Adding Bytes

- [append(_:)](foundation/nsmutabledata/append(_:).md)
- [increaseLength(by:)](foundation/nsmutabledata/increaselength(by:).md)
