# API Reference v10.3.1 (Python)

## StreamBuffer (class)

Module: zaber_motion.ascii

Represents a stream buffer with this number on a device. A stream buffer is a place to store a queue of stream actions.

The following example illustrates how you can obtain an instance of this type:

```py
from zaber_motion.ascii import Connection

connection = Connection.open_serial_port("COM3")
device = connection.get_device(1)
streams = device.streams
stream_buffer = streams.get_buffer(1)
```

Related Guides:

- [Streamed movement](https://software.zaber.com/motion-library/docs/guides/device_features/streams.md)

### Properties

#### `buffer_number` (read-only)

`stream_buffer.buffer_number`

Type: `int`

The number identifying the buffer on the device.

#### `device` (read-only)

`stream_buffer.device`

Type: [`Device`](https://software.zaber.com/motion-library/api/py/ascii/device.md)

The Device this buffer exists on.

### Methods

#### `erase()` (async available)

`stream_buffer.erase()`

Erase the contents of the buffer. This method fails if there is a stream writing to the buffer.

#### `get_content()` (async available)

`stream_buffer.get_content()`

Get the buffer contents as an array of strings.

##### Return Value

Type: `List[str]`

A string array containing all the stream commands stored in the buffer.
