download


Description:

[ Version ( since = "0.8.0" ) ]
public DownloadStream download (Service service, Cancellable? cancellable = null) throws Error

Downloads and returns a DownloadStream allowing the thumbnail data represented by this to be read.

To get the content type of the downloaded data, get_content_type can be called on the returned DownloadStream. Calling get_content_length on the stream will not return a meaningful result, however, as the stream is encoded in chunks, rather than by content length.

In order to cancel the download, a Cancellable passed in to cancellable must be cancelled using cancel. Cancelling the individual InputStream operations on the DownloadStream will not cancel the entire download; merely the read or close operation in question. See the cancellable for more details.

Parameters:

this

a MediaThumbnail

service

the Service

cancellable

a Cancellable for the entire download stream, or null

Returns:

a DownloadStream to download the thumbnail with, or null; unref with unref




2022 vala-language.org