<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMBlockBufferAccessDataBytes(_:atOffset:length:temporaryBlock:returnedPointerOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMBlockBufferAccessDataBytes"
  },
  "title" : "CMBlockBufferAccessDataBytes(_:atOffset:length:temporaryBlock:returnedPointerOut:)"
}
-->

# CMBlockBufferAccessDataBytes(_:atOffset:length:temporaryBlock:returnedPointerOut:)

Accesses potentially noncontiguous data in a block buffer.

```
func CMBlockBufferAccessDataBytes(_ theBuffer: CMBlockBuffer, atOffset offset: Int, length: Int, temporaryBlock: UnsafeMutableRawPointer, returnedPointerOut: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?>) -> OSStatus
```

## Parameters

`theBuffer`

`CMBlockBuffer` to operate on. Must not be `NULL`.

`offset`

Offset within the `CMBlockBuffer's` offset range.

`length`

Desired number of bytes to access at offset.

`temporaryBlock`

A piece of memory, assumed to be at least `length` bytes in size. Must not be `NULL`

`returnedPointerOut`

Receives `NULL` if the desired amount of data could not be accessed at the given offset. Receives non-`NULL` if it could. The value returned is either a direct pointer into the `CMBlockBuffer` or to the `temporaryBlock`. Must not be `NULL`.

## Return Value

Returns `kCMBlockBufferNoErr` if the desired amount of data could be accessed at the given offset.

## Discussion

This routine is use for accessing contiguous and noncontiguous data. If the data is contiguous, the routine will return a pointer to the given `CMBlockBuffer`.  If the data is not contiguous, the routine will copy the data into a temporary block and a pointer to this block will be returned.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)