-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
- if( &CGDataConsumerCreateWithCFData != NULL )
- {
- return CGDataConsumerCreateWithCFData( data );
- }
-#endif
- // make sure we keep it until done
- CFRetain( data );
- CGDataConsumerCallbacks callbacks;
- callbacks.putBytes = UMAPutBytesCFRefCallback;
- callbacks.releaseConsumer = UMAReleaseCFDataConsumerCallback;
- CGDataConsumerRef consumer = CGDataConsumerCreate( data , &callbacks );
- // if consumer couldn't be created, release the data again
- if ( consumer == NULL )
- CFRelease( data );
- return consumer;