---
title: "fill(_:offset:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdlmeshbuffer/fill(_:offset:)"
---

# fill(_:offset:)

Writes the specified data into the buffer.

## Declaration

```swift
func fill(_ data: Data, offset: Int)
```

## Parameters

- `data`: The data to be copied into the buffer.
- `offset`: The offset, in bytes, from the start of the buffer at which to write data.

## Discussion

Discussion If the length of the specified data (plus the offset parameter, if nonzero) is greater than the buffer’s length property, this method writes data only up to the end of the buffer.

## See Also

### Working with Data in a Buffer

- [map()](modelio/mdlmeshbuffer/map().md)
- [length](modelio/mdlmeshbuffer/length.md)
