<!--
{
  "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/CMBlockBuffer",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@T@CMBlockBufferRef"
  },
  "title" : "CMBlockBuffer"
}
-->

# CMBlockBuffer

A reference to a block buffer instance.

```
class CMBlockBuffer
```

## Topics

### Modifying a Block Buffer

[`append(length:allocator:range:flags:)`](/documentation/CoreMedia/CMBlockBuffer/append(length:allocator:range:flags:))

Adds a memory block to an existing block buffer.

[`append(buffer:allocator:flags:)`](/documentation/CoreMedia/CMBlockBuffer/append(buffer:allocator:flags:)-28keu)

Adds a memory block to a block buffer using a custom allocator.

[`append(buffer:allocator:flags:)`](/documentation/CoreMedia/CMBlockBuffer/append(buffer:allocator:flags:)-8fws8)

Adds a sliced memory block to a block buffer using a custom allocator.

[`append(length:allocator:deallocator:range:flags:)`](/documentation/CoreMedia/CMBlockBuffer/append(length:allocator:deallocator:range:flags:))

Adds a memory block to a block buffer using a custom allocator and deallocator.

[`append(buffer:deallocator:flags:)`](/documentation/CoreMedia/CMBlockBuffer/append(buffer:deallocator:flags:)-3bfef)

Adds a memory block to a block buffer with a custom deallocator.

[`append(buffer:deallocator:flags:)`](/documentation/CoreMedia/CMBlockBuffer/append(buffer:deallocator:flags:)-1ibzz)

Adds a sliced memory block to a block buffer with a custom deallocator.

[`CMBlockBuffer.CustomBlockAllocator`](/documentation/CoreMedia/CMBlockBuffer/CustomBlockAllocator)

A type that allocates memory blocks.

[`CMBlockBuffer.CustomBlockDeallocator`](/documentation/CoreMedia/CMBlockBuffer/CustomBlockDeallocator)

A type that deallocates memory blocks.

[`append(bufferReference:flags:)`](/documentation/CoreMedia/CMBlockBuffer/append(bufferReference:flags:))

Adds a reference to another block buffer.

[`assureBlockMemory()`](/documentation/CoreMedia/CMBlockBuffer/assureBlockMemory())

Assures that the system allocates all memory blocks.

[`withUnsafeMutableBytes(atOffset:_:)`](/documentation/CoreMedia/CMBlockBuffer/withUnsafeMutableBytes(atOffset:_:))

Accesses the data that a block buffer represents.

### Inspecting a Block Buffer

[`isEmpty`](/documentation/CoreMedia/CMBlockBuffer/isEmpty)

A Boolean value that indicates whether the block buffer is empty.

### Accessing the Type Identifier

[`typeID`](/documentation/CoreMedia/CMBlockBuffer/typeID)

The type identifier for block buffer objects.

### Data Types

[`CMBlockBuffer.Error`](/documentation/CoreMedia/CMBlockBuffer/Error)

A structure that defines block buffer errors.

[`CMBlockBuffer.Flags`](/documentation/CoreMedia/CMBlockBuffer/Flags)

A structure that defines feature and control flags.

[`CMBlockBuffer.Slice`](/documentation/CoreMedia/CMBlockBuffer/Slice)

A slice of a `CMBlockBuffer` instance.



---

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)