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

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

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