<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNBufferStream",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(pl)SCNBufferStream"
  },
  "title" : "SCNBufferStream"
}
-->

# SCNBufferStream

An object that manages a Metal buffer used by a custom shader program.

```
protocol SCNBufferStream : NSObjectProtocol
```

## Overview

Your app does not define classes that implement this protocol. Instead, you use the [`SCNProgram`](/documentation/SceneKit/SCNProgram) method [`handleBinding(ofBufferNamed:frequency:handler:)`](/documentation/SceneKit/SCNProgram/handleBinding(ofBufferNamed:frequency:handler:)) to register a block to be called by SceneKit. In that block, SceneKit provides a buffer stream object that you can use to write data to the buffer.

## Topics

### Writing Data to a Buffer

[`-  writeBytes:length:`](/documentation/SceneKit/SCNBufferStream/writeBytes(_:count:))

Copies the specified data bytes into the underlying Metal buffer for use by a shader.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)