Instance Method

getBytes:fromOffset:length:error:

Copies a specified range of bytes into a given buffer.

Declaration

- (NSUInteger)getBytes:(uint8_t *)buffer fromOffset:(long long)offset length:(NSUInteger)length error:(NSError **)error;

Parameters

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 NSError object that describes the problem.

Pass NULL if 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.

See Also

Getting Raw Data

- size

Returns the size in bytes of the file for the representation.

Deprecated