示例#1
0
        public TypeEnumOrFixedSize(byte unknownTypeSize)
        {
            var value = unknownTypeSize - 1;

            if (unchecked ((uint)value) > MaxTypeEnum)
            {
                SerializationThrowHelper.ThrowFixedSizeOutOfRange(unknownTypeSize);
            }
            _value = (byte)(UnknownFixedSizeFlag | value);
        }
示例#2
0
        public TypeEnumOrFixedSize(TypeEnum typeEnum)
        {
            var value = (byte)typeEnum;

            if (value > MaxTypeEnum)
            {
                SerializationThrowHelper.ThrowBadTypeEnum(value);
            }

            _value = value;
        }