Show / Hide Table of Contents

Class StreamProvider

Prepare the TorrentManager so individual files can be accessed while they are downloading.

Inheritance
System.Object
StreamProvider
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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>
In This Article
Back to top Generated by DocFX