-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMappableStreamInfo.cs
35 lines (28 loc) · 950 Bytes
/
MappableStreamInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Buffers;
using System.Collections.Generic;
namespace MappableFileStream
{
public readonly struct MappableStreamInfo
{
/// <summary>
/// Gets the amount of currently mapped memory.
/// </summary>
/// <returns></returns>
public ulong MappedMemory { get; init; }
/// <summary>
/// Gets the amount of items that are currently mapped.
/// </summary>
/// <returns></returns>
public int ItemCount { get; init; }
public int BlockSize { get; init; }
public int BlockSizeInBytes { get; init; }
public MappableStreamInfo(ICollection<Booklet> booklets, int blockSize, int blockSizeInBytes)
{
ItemCount = booklets.Count;
BlockSize = blockSize;
BlockSizeInBytes = blockSizeInBytes;
MappedMemory = (ulong)ItemCount * (ulong)BlockSizeInBytes;
}
}
}