Table of Contents

Class SimpleWritingChunkCache

Namespace
PureHDF.VOL.Native
Assembly
PureHDF.dll

A simple writing chunk cache which has not limits in size.

public class SimpleWritingChunkCache : IWritingChunkCache
Inheritance
SimpleWritingChunkCache
Implements

Constructors

SimpleWritingChunkCache()

public SimpleWritingChunkCache()

Methods

Flush(Action<ulong, Memory<byte>>?)

Flushes the chunk.

public void Flush(Action<ulong, Memory<byte>>? chunkWriter = null)

Parameters

chunkWriter Action<ulong, Memory<byte>>

The chunk writer used for chunks being flushed from the cache.

GetChunk(ulong, Func<Memory<byte>>, Action<ulong, Memory<byte>>)

Tries to get the chunk at the given index.

public Memory<byte> GetChunk(ulong chunkIndex, Func<Memory<byte>> chunkAllocator, Action<ulong, Memory<byte>> chunkWriter)

Parameters

chunkIndex ulong

The linear chunk index.

chunkAllocator Func<Memory<byte>>

The chunk allocator is used whenever the chunk is not already cached.

chunkWriter Action<ulong, Memory<byte>>

The chunk writer is used whenever the chunk is flushed from the cache.

Returns

Memory<byte>