readFile

abstract suspend fun readFile(filePath: String, mediaType: String? = null): Flow<ByteArray>

Reads a file from the specified path.

Return

A Flow of ByteArray representing the file data.

Parameters

filePath

The path of the file to read.

mediaType

Optional media type of the file.

Throws

If an error occurs during the read operation.

If the operation is cancelled.