---
title: "CMBlockBufferAccessDataBytes(_:atOffset:length:temporaryBlock:returnedPointerOut:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmblockbufferaccessdatabytes(_:atoffset:length:temporaryblock:returnedpointerout:)"
---

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

Accesses potentially noncontiguous data in a block buffer.

## Declaration

```swift
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

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

## Discussion

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.

## See Also

### Modifying a Block Buffer

- [CMBlockBufferAppendMemoryBlock(_:memoryBlock:length:blockAllocator:customBlockSource:offsetToData:dataLength:flags:)](coremedia/cmblockbufferappendmemoryblock(_:memoryblock:length:blockallocator:customblocksource:offsettodata:datalength:flags:).md)
- [CMBlockBufferAppendBufferReference(_:targetBBuf:offsetToData:dataLength:flags:)](coremedia/cmblockbufferappendbufferreference(_:targetbbuf:offsettodata:datalength:flags:).md)
- [CMBlockBufferAssureBlockMemory(_:)](coremedia/cmblockbufferassureblockmemory(_:).md)
- [CMBlockBufferCopyDataBytes(_:atOffset:dataLength:destination:)](coremedia/cmblockbuffercopydatabytes(_:atoffset:datalength:destination:).md)
- [CMBlockBufferReplaceDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)](coremedia/cmblockbufferreplacedatabytes(with:blockbuffer:offsetintodestination:datalength:).md)
- [CMBlockBufferFillDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)](coremedia/cmblockbufferfilldatabytes(with:blockbuffer:offsetintodestination:datalength:).md)
