Пример #1
0
        protected virtual async ValueTask InitAsync()
        {
            if (FanOut is not null)
            {
                return;
            }

            await Task.Yield();

            ChunkReader ??= FileBucket.OpenRead(_fileName);

            var(idType, chunkCount, chunkTableOffset) = await ReadHeaderAsync().ConfigureAwait(false);

            if (chunkCount == 0)
            {
                ChunkReader.Dispose();
                ChunkReader = null;
                return;
            }
            IdType = idType;


            await ReadChunks(chunkTableOffset, chunkCount).ConfigureAwait(false);
        }