---
title: "increaseLength(by:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutabledata/increaselength(by:)"
---

# increaseLength(by:)

Increases the length of the receiver by a given number of bytes.

## Declaration

```swift
func increaseLength(by extraLength: Int)
```

## Parameters

- `extraLength`: The number of bytes by which to increase the receiver’s length.

## Discussion

Discussion The additional bytes are all set to 0. important: Changing the length of a mutable data object invalidates any existing data pointers returned by the bytes or mutableBytes properties.

## See Also

### Related Documentation

- [length](foundation/nsmutabledata/length.md)

### Adding Bytes

- [append(_:length:)](foundation/nsmutabledata/append(_:length:).md)
- [append(_:)](foundation/nsmutabledata/append(_:).md)
