openFile

Opens Inbox file.

Return

Instance ready to read from the Inbox file

Parameters

api

reference to Inbox API

fileId

ID of the file to open

Throws

when inboxApi is not initialized or there's no connection

if there is an error while opening Inbox file

if there is an unknown error while opening Inbox file


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

Opens Inbox file and writes it into Sink with optimized chunk size InboxFileStream.OPTIMAL_SEND_SIZE.

Return

ID of the read file

Parameters

api

reference to Inbox API

fileId

ID of the file to open

sink

stream to write downloaded data

streamController

controls the process of reading file

Throws

IOException

if there is an error while writing stream

when inboxApi is not initialized or there's no connection

if there is an error while reading Inbox file

if there is an unknown error while reading Inbox file