Пример #1
0
        public static RecordBlock CreateNew(FileStream stream, DataStructure schema, long index)
        {
            stream.SeekToBlockHeader(index);
            stream.WriteBlockHeader(new BlockHeader()
            {
                BlockFragmented = false, BlockSequence = index, FreeBytes = Constants.Lengths.BlockLength, RecordCount = 0
            });
            stream.Write(new byte[Lengths.BlockLength], 0, Lengths.BlockLength);

            var block = new RecordBlock(stream, schema, index);

            return(block);
        }
Пример #2
0
        public static RecordBlock LoadFromStream(FileStream stream, DataStructure schema, long index)
        {
            var block = new RecordBlock(stream, schema, index);

            return(block);
        }