BTDB.KVDBLayer.FileCollectionWithFileInfos.SkipHeader C# (CSharp) Method

SkipHeader() static private method

static private SkipHeader ( AbstractBufferedReader reader ) : void
reader AbstractBufferedReader
return void
        internal static void SkipHeader(AbstractBufferedReader reader)
        {
            var magic = reader.ReadByteArrayRaw(MagicStartOfFile.Length);
            var withGuid = BitArrayManipulation.CompareByteArray(magic, magic.Length,
                MagicStartOfFileWithGuid, MagicStartOfFileWithGuid.Length) == 0;
            if (withGuid) reader.SkipGuid();
        }

Usage Example

Esempio n. 1
0
        internal static void SkipHeader(AbstractBufferedReader reader)
        {
            FileCollectionWithFileInfos.SkipHeader(reader);
            var type            = (KVFileType)reader.ReadUInt8();
            var withCommitUlong = type == KVFileType.KeyIndexWithCommitUlong || type == KVFileType.ModernKeyIndex || type == KVFileType.ModernKeyIndexWithUlongs;

            reader.SkipVInt64();  // generation
            reader.SkipVUInt32(); // trLogFileId
            reader.SkipVUInt32(); // trLogOffset
            reader.SkipVUInt64(); // keyValueCount
            if (withCommitUlong)
            {
                reader.SkipVUInt64();                  // commitUlong
            }
            if (type == KVFileType.ModernKeyIndex || type == KVFileType.ModernKeyIndexWithUlongs)
            {
                reader.SkipUInt8();
            }
            if (type == KVFileType.ModernKeyIndexWithUlongs)
            {
                var ulongCount = reader.ReadVUInt32();
                while (ulongCount-- > 0)
                {
                    reader.SkipVUInt64();
                }
            }
        }
All Usage Examples Of BTDB.KVDBLayer.FileCollectionWithFileInfos::SkipHeader