Function

CFURLGetBytes

Returns by reference the byte representation of a URL object.

Declaration

CFIndex CFURLGetBytes(CFURLRef url, UInt8 *buffer, CFIndex bufferLength);

Parameters

anURL

The URL object to convert to a byte representation.

buffer

The buffer where you want the bytes to be placed. If the buffer is of insufficient size, returns -1 and no bytes are placed in buffer. If NULL the needed length is computed and returned. The returned bytes are the original bytes from which the URL was created (not including the base URL). If the URL was created from a string, the bytes are the bytes of the string encoded via UTF-8.

bufferLength

The number of bytes in buffer.

Return Value

Returns the number of bytes in buffer that were filled. If the buffer is of insufficient size, returns -1.

See Also

Getting URL Properties

CFURLGetBaseURL

Returns the base URL of a given URL if it exists.

CFURLGetByteRangeForComponent

Returns the range of the specified component in the bytes of a URL.

CFURLGetTypeID

Returns the type identifier for the CFURL opaque type.

CFURLResourceIsReachable

Returns whether the resource pointed to by a file URL can be reached.