Instance Method

getBytes(_:range:)

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

Declaration

func getBytes(_ buffer: UnsafeMutableRawPointer, range: NSRange)

Parameters

buffer

A buffer into which to copy data.

range

The range of bytes in the receiver's data to copy to buffer. The range must lie within the range of bytes of the receiver's data.

Discussion

If range isn’t within the receiver’s range of bytes, an NSRangeException is raised.

See Also

Related Symbols

func getBytes(UnsafeMutableRawPointer)

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

var bytes: UnsafeRawPointer

A pointer to the receiver’s contents.

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.