static private SkipHeader ( AbstractBufferedReader reader ) : void | ||
reader | AbstractBufferedReader | |
Результат | 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();
}
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(); } } }