StorageStreamDownloader class
Definition
A streaming object to download from Azure Storage.
StorageStreamDownloader(clients=None, config=None, start_range=None, end_range=None, validate_content=None, encryption_options=None, max_concurrency=1, name=None, container=None, encoding=None, **kwargs)
- Inheritance
-
builtins.objectStorageStreamDownloader
Variables
- name
- str
- container
- str
- properties
- BlobProperties
- size
- int
Methods
chunks | |
content_as_bytes |
Download the contents of this file. This operation is blocking until all data is downloaded. |
content_as_text |
Download the contents of this blob, and decode as text. This operation is blocking until all data is downloaded. |
download_to_stream |
Download the contents of this blob to a stream. |
readall |
Download the contents of this blob. This operation is blocking until all data is downloaded. :rtype: bytes or str |
readinto |
Download the contents of this file to a stream. |
chunks
chunks()
content_as_bytes
Download the contents of this file.
This operation is blocking until all data is downloaded.
content_as_bytes(max_concurrency=1)
Parameters
- max_concurrency
Return type
content_as_text
Download the contents of this blob, and decode as text.
This operation is blocking until all data is downloaded.
content_as_text(max_concurrency=1, encoding='UTF-8')
Parameters
- encoding
- str
Test encoding to decode the downloaded bytes. Default is UTF-8.
- encoding
Return type
download_to_stream
Download the contents of this blob to a stream.
download_to_stream(stream, max_concurrency=1)
Parameters
- stream
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.
- max_concurrency
Returns
The properties of the downloaded blob.
Return type
readall
Download the contents of this blob.
This operation is blocking until all data is downloaded. :rtype: bytes or str
readall()
readinto
Download the contents of this file to a stream.
readinto(stream)
Parameters
- stream
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
The number of bytes read.