getBytes(_:fromOffset:length:error:)
Copies a specified range of bytes into a given buffer.
Declaration
func getBytes(_ buffer: UnsafeMutablePointer<UInt8>!, fromOffset offset: Int64, length: Int, error: NSErrorPointer) -> IntParameters
- buffer:
A buffer into which to copy the data.
You typically use Size() to allocate a buffer of the right size.
- offset:
The number of bytes from the beginning of the file to start copying.
- length:
The number of bytes to copy.
- error:
If an error occurs, upon return contains an
NSErrorobject that describes the problem.Pass
NULLif you do not want error information.
Return Value
The number of bytes actually written to buffer. The number of bytes read will be less than the requested range if the range exceeds the file’s size. If an error occurs, returns 0.
Discussion
This method returns the biggest, best representation available.