Package 

Class ByteStreamReceiver

    • Method Summary

      Modifier and Type Method Description
      Flow<ByteArray> getFlow() A Flow of stream data as it arrives.
      final ByteStreamInfo getInfo() Metadata for this stream.
      • Methods inherited from class io.livekit.android.room.datastream.incoming.ByteStreamReceiver

        readAll, readNext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFlow

         Flow<ByteArray> getFlow()

        A Flow of stream data as it arrives.

        Collect this flow to process incoming data incrementally. The flow completes normally when the stream receives all the data without error. If the stream ends abnormally, the flow fails with a StreamException after all buffered chunks have been emitted.

        Example:

        reader.flow
            .catch { e ->
                if (e is StreamException) {
                    handleStreamError(e)
                } else {
                    throw e
                }
            }
            .collect { chunk -> process(chunk) }