check point

This commit is contained in:
meelstorm
2025-07-14 12:03:59 +02:00
commit d3cb790bd9
431 changed files with 44078 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
using Inspectron.Fastbuffer.Interfaces;
namespace Inspectron.Fastbuffer;
public class IsolatedRingbuffer: IDisposable
{
private readonly string _path;
private readonly int _bufferSize;
private readonly IFilesystem _filesystem;
private readonly string _indexPath;
private readonly IndexFile _index;
public const string BufferDirectory = ".rb";
public const string IndexFile = "index.idx";
public IsolatedRingbuffer(string path, int bufferSize, IFilesystem filesystem)
{
_path = path;
_bufferSize = bufferSize;
_filesystem = filesystem;
_indexPath = Path.Combine(_path, BufferDirectory,IndexFile );
Directory.CreateDirectory(Path.Combine(_path, BufferDirectory));
_index = new IndexFile(_indexPath, _bufferSize, _filesystem);
}
public void Write(byte[] data, string fileName)
{
_index.WriteNextArtifact(data, fileName);
}
public void Dispose()
{
_filesystem.Dispose();
}
}