Contents

initWithBytesNoCopy

Initializes an instance of OSData to share the provided data buffer.

Declaration

virtual bool initWithBytesNoCopy( 
 void *bytes, 
 unsigned intnumBytes);

Parameters

  • bytes:

    The buffer of data to represent.

  • numBytes:

    The length of bytes.

Return Value

true on success, false on failure.

Overview

Not for general use. Use the static instance creation method withBytesNoCopy instead.

An OSData object initialized with this function does not claim ownership of the data buffer, but merely shares it with the caller.

An OSData object created with shared external data cannot append bytes, but you can get the byte pointer and modify bytes within the shared buffer.

See Also

Miscellaneous