Instance Property

bytes

A pointer to the receiver’s contents.

Declaration

var bytes: UnsafeRawPointer { get }

Discussion

If the length of the NSData object is 0, this property returns nil.

For an immutable data object, the returned pointer is valid until the data object is deallocated. For a mutable data object, the returned pointer is valid until the data object is deallocated or the data is mutated.

See Also

Related Symbols

func getBytes(UnsafeMutableRawPointer)

Copies a data object’s contents into a given buffer.

func getBytes(UnsafeMutableRawPointer, range: NSRange)

Copies a range of bytes from the receiver’s data into a given buffer.

var description: String

A string that contains a hexadecimal representation of the object’s contents in a property list format.

func getBytes(UnsafeMutableRawPointer, length: Int)

Copies a number of bytes from the start of the receiver's data into a given buffer.