Class DataBufferFramer
A utility class that allows a continuous stream of data to be written to it with properly framed messages being read out of it. This class is not thread-safe for concurrent reads/writes.
Inheritance
System.Object
DataBufferFramer
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class DataBufferFramer
Constructors
DataBufferFramer()
Initializes a new instance of the DataBufferFramer class.
Declaration
public DataBufferFramer()
Properties
AvailableDataBuffer
Gets the available data.
Declaration
public DataBuffer AvailableDataBuffer { get; }
Property Value
Type | Description |
---|---|
DataBuffer |
AvailableLength
Gets the available length.
Declaration
public int AvailableLength { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Footprint
Gets the size of the internal data buffer, in bytes.
Declaration
public int Footprint { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Destroy()
Destroys this instance.
Declaration
public void Destroy()
GetHexString()
Gets the hexadecimal string representing the current contents of the data buffer.
Declaration
public string GetHexString()
Returns
Type | Description |
---|---|
System.String |
Read(Function1<DataBuffer, Int32>)
Reads a data buffer from the internal data buffer.
Declaration
public DataBuffer Read(Function1<DataBuffer, int> getFrameLength)
Parameters
Type | Name | Description |
---|---|---|
Function1<DataBuffer, System.Int32> | getFrameLength | A callback that returns the next frame length. |
Returns
Type | Description |
---|---|
DataBuffer |
Write(DataBuffer)
Writes a data buffer to the internal data buffer.
Declaration
public void Write(DataBuffer dataBuffer)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | dataBuffer | The data buffer. |