public TypeEnumOrFixedSize(byte unknownTypeSize) { var value = unknownTypeSize - 1; if (unchecked ((uint)value) > MaxTypeEnum) { SerializationThrowHelper.ThrowFixedSizeOutOfRange(unknownTypeSize); } _value = (byte)(UnknownFixedSizeFlag | value); }
public TypeEnumOrFixedSize(TypeEnum typeEnum) { var value = (byte)typeEnum; if (value > MaxTypeEnum) { SerializationThrowHelper.ThrowBadTypeEnum(value); } _value = value; }