Class ByteStreamReader
- Namespace
- LiveKit
Reader for an incoming byte data stream.
public sealed class ByteStreamReader
- Inheritance
-
ByteStreamReader
- Inherited Members
- Extension Methods
Properties
Info
public ByteStreamInfo Info { get; }
Property Value
Methods
ReadAll()
Reads all incoming chunks from the stream, concatenating them into a single value once the stream closes normally.
public ByteStreamReader.ReadAllInstruction ReadAll()
Returns
- ByteStreamReader.ReadAllInstruction
A ByteStreamReader.ReadAllInstruction that completes when the stream is complete or errors. Check ReadAllInstruction.IsError and access Bytes properties to handle the result.
Remarks
Calling this method consumes the stream reader.
ReadIncremental()
Reads incoming chunks from the stream incrementally.
public ByteStreamReader.ReadIncrementalInstruction ReadIncremental()
Returns
- ByteStreamReader.ReadIncrementalInstruction
A ByteStreamReader.ReadIncrementalInstruction that allows reading the stream incrementally.
WriteToFile(string, string)
Reads incoming chunks from the byte stream, writing them to a file as they are received.
public ByteStreamReader.WriteToFileInstruction WriteToFile(string directory = null, string nameOverride = null)
Parameters
directorystringThe directory to write the file in. The system temporary directory is used if not specified.
nameOverridestringThe name to use for the written file, overriding stream name.
Returns
- ByteStreamReader.WriteToFileInstruction
A ByteStreamReader.WriteToFileInstruction that completes when the stream is complete or errors. Check WriteToFileInstruction.IsError and access FilePath properties to handle the result.
Remarks
Calling this method consumes the stream reader.