Table of Contents

Class CircularBuffer

Namespace
NAudio.Utils
Assembly
NAudio.Core.dll

A very basic circular buffer implementation

public class CircularBuffer
Inheritance
CircularBuffer
Inherited Members

Constructors

CircularBuffer(int)

Create a new circular buffer

public CircularBuffer(int size)

Parameters

size int

Max buffer size in bytes

Properties

Count

Number of bytes currently stored in the circular buffer

public int Count { get; }

Property Value

int

MaxLength

Maximum length of this circular buffer

public int MaxLength { get; }

Property Value

int

Methods

Advance(int)

Advances the buffer, discarding bytes

public void Advance(int count)

Parameters

count int

Bytes to advance

Read(byte[], int, int)

Read from the buffer

public int Read(byte[] data, int offset, int count)

Parameters

data byte[]

Buffer to read into

offset int

Offset into read buffer

count int

Bytes to read

Returns

int

Number of bytes actually read

Reset()

Resets the buffer

public void Reset()

Write(byte[], int, int)

Write data to the buffer

public int Write(byte[] data, int offset, int count)

Parameters

data byte[]

Data to write

offset int

Offset into data

count int

Number of bytes to write

Returns

int

number of bytes written