MonobjcMonobjc Documented Class Library
NSData Constructor (bytes, length, flag)
NamespacesMonobjc.FoundationNSDataNSData(IntPtr, NSUInteger, Boolean)

Initializes a newly allocated data object by adding to it length bytes of data from the buffer bytes.

Original signature is '- (id)initWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)flag'

Available in Mac OS X v10.2 and later.

Declaration Syntax
C#Visual BasicVisual C++
public NSData(
	IntPtr bytes,
	NSUInteger length,
	bool flag
)
Public Sub New ( _
	bytes As IntPtr, _
	length As NSUInteger, _
	flag As Boolean _
)
public:
NSData(
	IntPtr bytes, 
	NSUInteger length, 
	bool flag
)
Parameters
bytes (IntPtr)
A buffer containing data for the new object. If flag is YES, bytes must point to a memory block allocated with malloc.
length (NSUInteger)
The number of bytes to hold from bytes. This value must not exceed the length of bytes.
flag (Boolean)
If YES, the returned object takes ownership of the bytes pointer and frees it on deallocation.
Return Value
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)