Create NSData from dispatch_data
| Originator: | robnapier | ||
| Number: | rdar://15160723 | Date Originated: | 05-Oct-2013 08:12 PM |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | |
| Classification: | Reproducible: |
It should be possible to create an NSData from a dispatch_data without copying, even if the dispatch_data has multiple regions. The existence of -enumerateByteRangesUsingBlock: suggests that this functionality exists in some form internally, but it is not exposed in the SDK. Obviously NSMutableData would need to make a copy, just like in initWithData:. The natural name for this would be -initWithDispatchData:.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!