MonobjcMonobjc Documented Class Library
DataWithBytesNoCopyLengthFreeWhenDone Method (bytes, length, freeWhenDone)
NamespacesMonobjc.FoundationNSDataDataWithBytesNoCopyLengthFreeWhenDone(IntPtr, NSUInteger, Boolean)

Creates and returns a data object that holds a given number of bytes from a given buffer.

Original signature is '+ (id)dataWithBytesNoCopy:(void *)bytes length:(NSUInteger)length freeWhenDone:(BOOL)freeWhenDone'

Available in Mac OS X v10.2 and later.

Declaration Syntax
C#Visual BasicVisual C++
public static NSData DataWithBytesNoCopyLengthFreeWhenDone(
	IntPtr bytes,
	NSUInteger length,
	bool freeWhenDone
)
Public Shared Function DataWithBytesNoCopyLengthFreeWhenDone ( _
	bytes As IntPtr, _
	length As NSUInteger, _
	freeWhenDone As Boolean _
) As NSData
public:
static NSData^ DataWithBytesNoCopyLengthFreeWhenDone(
	IntPtr bytes, 
	NSUInteger length, 
	bool freeWhenDone
)
Parameters
bytes (IntPtr)
A buffer containing data for the new object. If freeWhenDone 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.
freeWhenDone (Boolean)
If YES, the returned object takes ownership of the bytes pointer and frees it on deallocation.
Return Value
A data object that holds length bytes from the buffer bytes. 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)