Class StreamProvider
Prepare the TorrentManager so individual files can be accessed while they are downloading.
Inheritance
Inherited Members
Namespace: MonoTorrent.Streaming
Assembly: MonoTorrent.dll
Syntax
public class StreamProvider
Methods
CreateHttpStreamAsync(ITorrentFileInfo)
Creates a System.IO.Stream which can be used to access the given TorrentFile while it is downloading. This stream is seekable and readable. This stream must be disposed before another stream can be created.
Declaration
public Task<IUriStream> CreateHttpStreamAsync(ITorrentFileInfo file)
Parameters
| Type | Name | Description |
|---|---|---|
| ITorrentFileInfo | file | The file to open |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IUriStream> |
CreateHttpStreamAsync(ITorrentFileInfo, Boolean)
Creates a System.IO.Stream which can be used to access the given TorrentFile while it is downloading. This stream is seekable and readable. This stream must be disposed before another stream can be created.
Declaration
public Task<IUriStream> CreateHttpStreamAsync(ITorrentFileInfo file, bool prebuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ITorrentFileInfo | file | The file to open |
| System.Boolean | prebuffer | True if the first and last piece should be downloaded before the Stream is created. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IUriStream> |
CreateHttpStreamAsync(ITorrentFileInfo, Boolean, CancellationToken)
Creates a System.IO.Stream which can be used to access the given TorrentFile while it is downloading. This stream is seekable and readable. This stream must be disposed before another stream can be created.
Declaration
public Task<IUriStream> CreateHttpStreamAsync(ITorrentFileInfo file, bool prebuffer, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| ITorrentFileInfo | file | The file to open |
| System.Boolean | prebuffer | True if the first and last piece should be downloaded before the Stream is created. |
| System.Threading.CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IUriStream> |
CreateHttpStreamAsync(ITorrentFileInfo, CancellationToken)
Creates a System.IO.Stream which can be used to access the given TorrentFile while it is downloading. This stream is seekable and readable. This stream must be disposed before another stream can be created.
Declaration
public Task<IUriStream> CreateHttpStreamAsync(ITorrentFileInfo file, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| ITorrentFileInfo | file | The file to open |
| System.Threading.CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IUriStream> |
CreateStreamAsync(ITorrentFileInfo)
Creates a System.IO.Stream which can be used to access the given TorrentFile while it is downloading. This stream is seekable and readable. The first and last pieces of this file will be buffered before the stream is created. Finally, this stream must be disposed before another stream can be created.
Declaration
public Task<Stream> CreateStreamAsync(ITorrentFileInfo file)
Parameters
| Type | Name | Description |
|---|---|---|
| ITorrentFileInfo | file | The file to open |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.IO.Stream> |
CreateStreamAsync(ITorrentFileInfo, Boolean)
Creates a System.IO.Stream which can be used to access the given TorrentFile
while it is downloading. This stream is seekable and readable. The first and last pieces of
this file will be buffered before the stream is created if prebuffer is
set to true. Finally, this stream must be disposed before another stream can be created.
Declaration
public Task<Stream> CreateStreamAsync(ITorrentFileInfo file, bool prebuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ITorrentFileInfo | file | The file to open |
| System.Boolean | prebuffer | True if the first and last piece should be downloaded before the Stream is created. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.IO.Stream> |
CreateStreamAsync(ITorrentFileInfo, Boolean, CancellationToken)
Creates a System.IO.Stream which can be used to access the given TorrentFile
while it is downloading. This stream is seekable and readable. The first and last pieces of
this file will be buffered before the stream is created if prebuffer is
set to true. Finally, this stream must be disposed before another stream can be created.
Declaration
public Task<Stream> CreateStreamAsync(ITorrentFileInfo file, bool prebuffer, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| ITorrentFileInfo | file | The file to open |
| System.Boolean | prebuffer | True if the first and last piece should be downloaded before the Stream is created. |
| System.Threading.CancellationToken | token | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.IO.Stream> |
CreateStreamAsync(ITorrentFileInfo, CancellationToken)
Creates a System.IO.Stream which can be used to access the given TorrentFile while it is downloading. This stream is seekable and readable. The first and last pieces of this file will be buffered before the stream is created. Finally, this stream must be disposed before another stream can be created.
Declaration
public Task<Stream> CreateStreamAsync(ITorrentFileInfo file, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| ITorrentFileInfo | file | The file to open |
| System.Threading.CancellationToken | token | The cancellation token |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.IO.Stream> |