Commonly Used Methods - bytes Returns a pointer to the data object's contents. Primitive Methods - bytes Returns a pointer to the data object's contents. NSMutableData provide data objects, object-oriented wrappers for byte buffers. NSData creates static data objects, and NSMutableData creates dynamic data objects. They're typically used for data storage, and are also useful in Distributed Objects applications, where data contained in data objects can be copied or moved between applications.
Data objects can wrap data of any size.
When the data size is more than a few memory pages, the object uses virtual memory management. A data object can also wrap pre-existing data, regardless of how the data was allocated. For typed data, use NSValue. Because of the nature of class clusters, data objects are not actual instances of the NSData or NSMutableData classes but instead are instances of one of their private subclasses. Although a data object's class is private, its interface is public, as declared by these abstract superclasses, NSData and NSMutableData.