openFile

Opens Store file.

Return

Instance ready to read from the Store file

Parameters

api

reference to Store API

fileId

ID of the file to open

Throws

when storeApi is not initialized or there's no connection

if there is an error while opening Store file

if there is an unknown error while opening Store file


fun openFile(api: StoreApi, fileId: String, sink: Sink, streamController: StoreFileStream.Controller? = null): String

Opens Store file and writes it into Sink.

Return

ID of the read file

Parameters

api

reference to Store API

fileId

ID of the file to open

sink

stream to write downloaded data with optimized chunk size StoreFileStream.OPTIMAL_SEND_SIZE

streamController

controls the process of reading file

Throws

IOException

if there is an error while writing stream

when storeApi is not initialized or there's no connection

if there is an error while reading Store file

if there is an unknown error while reading Store file