Class CircularBuffer
A circular buffer.
Inheritance
System.Object
CircularBuffer
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class CircularBuffer
Constructors
CircularBuffer(Int32, Int32)
Initializes a new instance of the CircularBuffer class.
Declaration
public CircularBuffer(int length, int latency)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | length | The length. |
System.Int32 | latency | The latency. |
CircularBuffer(Int32, Int32, Boolean)
Initializes a new instance of the CircularBuffer class.
Declaration
public CircularBuffer(int length, int latency, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | length | The length. |
System.Int32 | latency | The latency. |
System.Boolean | littleEndian | Whether the data is little-endian. |
Properties
Available
Gets the number of bytes available for reading.
Declaration
public int Available { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Latency
Gets the latency.
Declaration
public int Latency { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Length
Gets the length.
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
LittleEndian
Gets or sets whether the data is little-endian.
Declaration
public bool LittleEndian { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ReadOffset
Gets the read offset.
Declaration
public int ReadOffset { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
WriteOffset
Gets the read offset.
Declaration
public int WriteOffset { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Read(Int32)
Reads data from the buffer.
Declaration
public DataBuffer Read(int length)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | length | The number of bytes to read. |
Returns
Type | Description |
---|---|
DataBuffer |
Write(DataBuffer)
Writes data to the buffer.
Declaration
public void Write(DataBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | buffer | The data to write. |