Contents

initWithBytes

Initializes an instance of OSData with a copy of the provided data buffer.

Declaration

virtual bool initWithBytes( 
 const void *bytes, 
 unsigned intnumBytes);

Parameters

  • bytes:

    The buffer of data to copy.

  • numBytes:

    The length of bytes.

Return Value

true on success, false on failure.

Overview

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

The new OSData object will grow as needed to accommodate more bytes (unlikeCFMutableData, for which a nonzero initial capacity is a hard limit).

See Also

Miscellaneous