Show / Hide Table of Contents

Interface IBlockCache

Inherited Members
System.IDisposable.Dispose()
Namespace: MonoTorrent.Client.PieceWriters
Assembly: MonoTorrent.dll
Syntax
public interface IBlockCache : IDisposable

Methods

ReadAsync(ITorrentData, BlockInfo, Byte[])

Reads data from the cache and flushes it to disk, or reads the data from disk if it is not available in the cache.

Declaration
ReusableTask<bool> ReadAsync(ITorrentData torrent, BlockInfo block, byte[] buffer)
Parameters
Type Name Description
ITorrentData torrent
BlockInfo block
System.Byte[] buffer
Returns
Type Description
ReusableTasks.ReusableTask<System.Boolean>

ReadFromCacheAsync(ITorrentData, BlockInfo, Byte[])

If the block of data is available in the cache, the data is read into the buffer and the method returns true. If the block is unavailable, the buffer will not be modified and the method will return false.

Declaration
ReusableTask<bool> ReadFromCacheAsync(ITorrentData torrent, BlockInfo block, byte[] buffer)
Parameters
Type Name Description
ITorrentData torrent
BlockInfo block
System.Byte[] buffer
Returns
Type Description
ReusableTasks.ReusableTask<System.Boolean>

WriteAsync(ITorrentData, BlockInfo, Byte[], Boolean)

Declaration
ReusableTask WriteAsync(ITorrentData torrent, BlockInfo block, byte[] buffer, bool preferSkipCache)
Parameters
Type Name Description
ITorrentData torrent
BlockInfo block
System.Byte[] buffer
System.Boolean preferSkipCache
Returns
Type Description
ReusableTasks.ReusableTask
In This Article
Back to top Generated by DocFX