---
title: "init(contentsOfURL:options:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsdata/init(contentsofurl:options:)-39obs"
---

# init(contentsOfURL:options:)

## Declaration

```swift
convenience init(contentsOfURL url: URL, options readOptionsMask: NSData.ReadingOptions = []) throws
```
