Example #1
0
        public static CompactId Read(IExtendedBinaryReader reader)
        {
            var id      = (IdType)reader.ReadByte();
            var version = reader.ReadByte();
            var info    = reader.ReadUInt32();

            return(new CompactId(id, version, info));
        }
        /// <summary>
        /// check if the section guard is in place
        /// </summary>
        internal static void CheckGuard(IExtendedBinaryReader reader)
        {
            uint observedGuard = reader.ReadUInt32();

            if (observedGuard != CacheConstants.GuardInt)
            {
                throw new InvalidDataException($"Expected a guard integer ({CacheConstants.GuardInt}), but found another value: ({observedGuard})");
            }
        }