Contents

withCapacity

Allocates an OSData object with preallocated capacity.

Declaration

static OSDataPtr withCapacity(uint32_t capacity);

Parameters

  • capacity:

    Number of bytes of data the object can hold.

Return Value

NULL on failure, otherwise the allocated OSData with reference count 1 to be released by the caller.

Discussion

Allocates an OSData object with preallocated capacity. The OSData will have zero length until data is added to it with appendBytes().

See Also

Creating a Data Object