# danog\MadelineProto\ResumableDownloadStream: A readable stream with the contents of a file downloaded from Telegram.

> 
The stream can be serialized: once unserialized, the download is restarted from the end of the last chunk
returned by {@see self::read()} before serialization.

The progress callback and the cancellation passed when creating the stream are not preserved by serialization.


[Back to index](../../index.html)

> Author: Daniil Gentili <daniil@daniil.it>  
  

A readable stream with the contents of a file downloaded from Telegram.  


The stream can be serialized: once unserialized, the download is restarted from the end of the last chunk
returned by {@see self::read()} before serialization.

The progress callback and the cancellation passed when creating the stream are not preserved by serialization.



## Method list:
* [`read(?\Amp\Cancellation $cancellation = NULL): ?string`](#read)
* [`isReadable(): bool`](#isReadable)
* [`close(): void`](#close)
* [`isClosed(): bool`](#isClosed)
* [`onClose(\Closure $onClose): void`](#onClose)
* [`getIterator(): \Traversable<int, string>`](#getIterator)

## Methods:
### <a name="read"></a> `read(?\Amp\Cancellation $cancellation = NULL): ?string`




Parameters:

* `$cancellation`: `?\Amp\Cancellation`   


#### See also: 
* `\Amp\Cancellation`




### <a name="isReadable"></a> `isReadable(): bool`





### <a name="close"></a> `close(): void`





### <a name="isClosed"></a> `isClosed(): bool`





### <a name="onClose"></a> `onClose(\Closure $onClose): void`




Parameters:

* `$onClose`: `\Closure`   


#### See also: 
* `\Closure`




### <a name="getIterator"></a> `getIterator(): \Traversable<int, string>`




#### See also: 
* `\Traversable`




---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
