Ejemplo n.º 1
0
        public Block(long id, BlockOptions options, Stream stream)
        {
            Id                      = id;
            _options                = options;
            _stream                 = stream;
            _blockHeadersCount      = options.BlockHeaderSize / _1B;
            _cachedHeaders          = BlockHeader.ToDictionary <long?>();
            _blockFirstSector       = new byte[_options.DiskSectorSize];
            _originPositionInStream = Id * _options.BlockSize;

            ReadBlockFirstSector();
        }
Ejemplo n.º 2
0
 public BlockStorage(Stream stream, BlockOptions options)
 {
     _stream  = stream ?? throw new ArgumentNullException(nameof(stream));
     _options = options ?? throw new ArgumentNullException(nameof(options));
 }