A block buffer that provides read-only access to the a range of bytes.
Block buffer provides a contiguous range of data offsets (from 0 to ``count``) across a possibly non-contiguous
range of bytes. The byte range may contain memory blocks and buffer references. The bytes held by this buffer can
not be modified. However, the composition of the byte range can be changed by appending other memory blocks or
buffer references.
Create a readonly block buffer from an existing block buffer.
This init will make sure that all memory referenced by `unsafeBlockBuffer` is allocated by
calling ``CMBlockBuffer/assureBlockMemory()``.
- Parameter unsafeBlockBuffer: The ``CMBlockBuffer`` which will be subsumed by the new instance.
get · iOS 26.0+
startIndex
TypeScript
get startIndex(): number
Swift declaration
var startIndex: Int { get }
The position of the first element.
get · iOS 26.0+
isContiguous
TypeScript
get isContiguous(): boolean
Swift declaration
var isContiguous: Bool { get }
Determine whether the block buffer is contiguous.
`true` if block buffer references a single contiguous memory block `false` otherwise. Also `false` if the buffer
is empty.
Access contents of the buffer if available as contiguous memory block.
This method calls body(buffer), where buffer is a pointer to the block buffers contiguous storage. If the
contiguous storage doesn’t exist, the method doesn’t call body — it immediately returns nil.
Access contents of the buffer if available as contiguous memory block.
This method calls body(buffer), where buffer is a pointer to the block buffers contiguous storage. If the
contiguous storage doesn’t exist, the method doesn’t call body — it immediately returns nil.
get · iOS 26.0+
count
TypeScript
get count(): number
Swift declaration
var count: Int { get }
The number of bytes in the block buffer.
This count is the sum of the number of bytes in each memory block and buffer reference held in the block buffer.
Note that the buffer references may hold more data than referenced by this block buffer. This block buffer presents
a contiguous range of offsets from 0 to `count`.
Append a reference to a range of another block buffer.
The range within the block buffer is not required to be contiguous. Providing out of bounds range will result in
a precondition failure.
- Parameter referenceOf: Other block buffer to be referenced by this block buffer.
- Parameter optimizeDepth: Keep the depth of buffer reference graph to a minimum.
get · iOS 26.0+
indices
TypeScript
get indices(): SDKHandle
Swift declaration
var indices: Range<Int> { get }
The indices that are valid for subscripting the collection, in ascending order.
get · iOS 26.0+
isEmpty
TypeScript
get isEmpty(): boolean
Swift declaration
var isEmpty: Bool { get }
Indicates whether the block buffer is empty.
Indicates whether the block buffer is empty, i.e., devoid of any memory blocks or block buffer references. Note
that a block buffer containing a not-yet allocated memory block is not considered empty.
get · iOS 26.0+
regions
TypeScript
get regions(): Array<CMReadOnlyDataBlockBuffer_BlockRegion>
Swift declaration
var regions: [CMReadOnlyDataBlockBuffer.BlockRegion] { get }
The regions that make up the storage of the block buffer.
get · iOS 26.0+
endIndex
TypeScript
get endIndex(): number
Swift declaration
var endIndex: Int { get }
The position one greater than the last valid subscript argument.
The iOS SDK compiler rejected this binding: instance method 'arg' requires that 'CMMutableDataBlockBuffer' conform to 'Copyable'
CMReadOnlyDataBlockBuffer.attachments
The iOS SDK compiler rejected this binding: instance method 'out' requires that 'CMReadOnlyDataBlockBuffer.Attachments' (aka 'CVAttachmentAccess<CMBlockBufferAttachmentKeyDefinitions>') be a class type
CMReadOnlyDataBlockBuffer.attachments
The iOS SDK compiler rejected this binding: instance method 'arg' requires that 'CMReadOnlyDataBlockBuffer.Attachments' (aka 'CVAttachmentAccess<CMBlockBufferAttachmentKeyDefinitions>') conform to 'Escapable'