Exemple #1
0
        /// <summary>
        /// ReadUntagged
        /// </summary>
        protected void ReadUntagged(global::Microsoft.Bond.IProtocolReader reader)
        {
            bool canOmitFields = reader.HasCapability(global::Microsoft.Bond.Protocol.CanOmitFields);

            Reset();


            reader.ReadStructBegin();

            if (!canOmitFields || !reader.ReadFieldOmitted())
            {
                this.blobValue = this.blobValue.FromData(global::Microsoft.Bond.ReadHelper.ReadBlob(reader, global::Microsoft.Bond.BondDataType.BT_LIST));
            }
            else
            {
                throw new BondException("Missing required field \"blobValue\", id=10");
            }
            reader.ReadStructEnd();
        }   // ~ReadUntagged()
Exemple #2
0
        }   // ~ReadUntagged()

        /// <summary>
        /// Read
        /// </summary>
        protected void Read(global::Microsoft.Bond.IProtocolReader reader, out bool isPartialStruct)
        {
            Reset();
            BitArray seenRequiredFields = new BitArray(11);

            reader.ReadStructBegin(true);

            while (true)
            {
                BondDataType type = BondDataType.BT_STOP;
                UInt16       id   = UInt16.MaxValue;

                reader.ReadFieldBegin(out type, out id);

                if (type == BondDataType.BT_STOP || type == BondDataType.BT_STOP_BASE)
                {
                    isPartialStruct = (type == BondDataType.BT_STOP_BASE);
                    break;
                }

                switch (id)
                {
                case __ordinals.blobValue:      // id=10
                    this.blobValue = global::Microsoft.Bond.ReadHelper.ReadBlob(reader, type);
                    seenRequiredFields.Set(__ordinals.blobValue, true);
                    break;

                default:
                    reader.Skip(type);
                    break;
                } // ~switch

                reader.ReadFieldEnd();
            } // ~while

            reader.ReadStructEnd();

            CheckRequiredFieldsAreSeen(seenRequiredFields);
        }   // ~Read()
Exemple #3
0
        /// <summary>
        /// Read
        /// </summary>
        public virtual void Read(global::Microsoft.Bond.IProtocolReader reader)
        {
            if (!reader.HasCapability(global::Microsoft.Bond.Protocol.Tagged))
            {
                ReadUntagged(reader);
            }
            else
            {
                bool isPartialStruct;

                if (reader.HasCapability((global::Microsoft.Bond.Protocol)global::Microsoft.Bond.ProtocolInternal.CloneableBonded))
                {
                    reader = reader.Clone();
                }

                Read(reader, out isPartialStruct);

                if (isPartialStruct)
                {
                    global::Microsoft.Bond.ReadHelper.SkipPartialStruct(reader);
                }
            }
        }
Exemple #4
0
 /// <summary>
 /// Read
 /// </summary>
 public virtual void Read(global::Microsoft.Bond.IProtocolReader reader, IBondSerializable schema)
 {
     Read(ProtocolHelper.CreateReader(reader, schema));
 }