public FileKeyIndex(AbstractBufferedReader reader, Guid? guid, bool withCommitUlong, bool modern) { _guid = guid; _generation = reader.ReadVInt64(); _trLogFileId = reader.ReadVUInt32(); _trLogOffset = reader.ReadVUInt32(); _keyValueCount = (long)reader.ReadVUInt64(); _commitUlong = withCommitUlong ? reader.ReadVUInt64() : 0; _compressionType = modern ? (KeyIndexCompression)reader.ReadUInt8() : KeyIndexCompression.Old; }
internal static void SkipHeader(AbstractBufferedReader reader) { FileCollectionWithFileInfos.SkipHeader(reader); var withCommitUlong = reader.ReadUInt8() == (byte)KVFileType.KeyIndexWithCommitUlong; reader.SkipVInt64(); // generation reader.SkipVUInt32(); // trLogFileId reader.SkipVUInt32(); // trLogOffset reader.SkipVUInt64(); // keyValueCount if (withCommitUlong) reader.SkipVUInt64(); // commitUlong }
internal static void SkipHeader(AbstractBufferedReader reader) { FileCollectionWithFileInfos.SkipHeader(reader); var type = (KVFileType)reader.ReadUInt8(); var withCommitUlong = type == KVFileType.KeyIndexWithCommitUlong || type == KVFileType.ModernKeyIndex; reader.SkipVInt64(); // generation reader.SkipVUInt32(); // trLogFileId reader.SkipVUInt32(); // trLogOffset reader.SkipVUInt64(); // keyValueCount if (withCommitUlong) reader.SkipVUInt64(); // commitUlong if (type == KVFileType.ModernKeyIndex) reader.SkipUInt8(); }