MonobjcMonobjc Documented Class Library
DataWithContentsOfFileOptionsError Method (path, mask, errorPtr)
NamespacesMonobjc.FoundationNSDataDataWithContentsOfFileOptionsError(NSString, NSDataReadingOptions, NSError%)

Creates and returns a data object by reading every byte from the file specified by a given path.

Original signature is '+ (id)dataWithContentsOfFile:(NSString *)path options:(NSDataReadingOptions)mask error:(NSError **)errorPtr'

Available in Mac OS X v10.4 and later.

Declaration Syntax
C#Visual BasicVisual C++
public static NSData DataWithContentsOfFileOptionsError(
	NSString path,
	NSDataReadingOptions mask,
	out NSError errorPtr
)
Public Shared Function DataWithContentsOfFileOptionsError ( _
	path As NSString, _
	mask As NSDataReadingOptions, _
	<OutAttribute> ByRef errorPtr As NSError _
) As NSData
public:
static NSData^ DataWithContentsOfFileOptionsError(
	NSString^ path, 
	NSDataReadingOptions mask, 
	[OutAttribute] NSError^% errorPtr
)
Parameters
path (NSString)
The absolute path of the file from which to read data.
mask (NSDataReadingOptions)
A mask that specifies options for reading the data. Constant components are described in “NSDataReadingOptions”.
errorPtr (NSError%)
If an error occurs, upon return contains an NSError object that describes the problem.
Return Value
A data object by reading every byte from the file specified by path. Returns nil if the data object could not be created.
Version Information
  • Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)

Assembly: Monobjc.Foundation (Module: Monobjc.Foundation)