NSMutableData provide data objects, object-oriented wrappers for byte buffers. They are 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. NSData creates static data objects, and NSMutableData creates dynamic data objects. You can easily convert one type of data object to the other with the constructor or initializer that takes an NSData or NSMutableData as an argument.
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. The bytes method returns a pointer to the bytes contained in the data object. To extract a data object that contains a subset of the bytes in another data object, use the subdataWithRange method.