Del via


StorageStreamDownloader Class

A streaming object to download from Azure Storage.

Inheritance
builtins.object
StorageStreamDownloader

Constructor

StorageStreamDownloader(downloader)

Parameters

Name Description
downloader
Required

Variables

Name Description
name
str

The name of the file being downloaded.

properties

The properties of the file being downloaded. If only a range of the data is being downloaded, this will be reflected in the properties.

size
int

The size of the total data in the stream. This will be the byte range if specified, otherwise the total size of the file.

Methods

chunks

Iterate over chunks in the download stream.

read

Read up to size bytes from the stream and return them. If size is unspecified or is -1, all bytes will be read.

readall

Download the contents of this file.

This operation is blocking until all data is downloaded. :returns: The contents of the specified file. :rtype: bytes

readinto

Download the contents of this file to a stream.

chunks

Iterate over chunks in the download stream.

chunks() -> Iterator[bytes]

Returns

Type Description

An iterator containing the chunks in the download stream.

read

Read up to size bytes from the stream and return them. If size is unspecified or is -1, all bytes will be read.

read(size: int | None = -1) -> bytes

Parameters

Name Description
size
int

The number of bytes to download from the stream. Leave unspecified or set to -1 to download all bytes.

Default value: -1

Returns

Type Description

The requested data as bytes. If the return value is empty, there is no more data to read.

readall

Download the contents of this file.

This operation is blocking until all data is downloaded. :returns: The contents of the specified file. :rtype: bytes

readall() -> bytes

readinto

Download the contents of this file to a stream.

readinto(stream: IO[bytes]) -> int

Parameters

Name Description
stream
Required

The stream to download to. This can be an open file-handle, or any writable stream. The stream must be seekable if the download uses more than one parallel connection.

Returns

Type Description
int

The number of bytes read.