Function readDataFromStream

  • Creates a data reader for the given stream, passes it to the given callback function and releases the stream reader lock after callback execution.

    Parameters

    • stream: ReadableStream<Uint8Array>

      The stream to read from.

    • callback: (reader: DataReader) => void | Promise<void>

      The callback function to call with the created data reader as argument.

    • Optionaloptions: DataReaderOptions

      Optional data reader options.

    Returns Promise<void>