Initializer

init(contentsOfFile:options:)

Returns a data object initialized by reading into it the data from the file specified by a given path.

Declaration

init(contentsOfFile path: String, options readOptionsMask: NSData.ReadingOptions = []) throws

Parameters

path

The absolute path of the file from which to read data.

mask

A mask that specifies options for reading the data. Constant components are described in NSData.ReadingOptions.

errorPtr

If an error occurs, upon return contains an NSError object that describes the problem.

Return Value

A data object initialized by reading into it the data from the file specified by path. The returned object might be different than the original receiver.

Discussion