Пример #1
0
 protected virtual void EnsureInitialized <T>(ref T obj, SectionFlag section) where T : class, new()
 {
     if (AmqpMessage.EnsureInitialized(ref obj))
     {
         this.sectionFlags |= section;
     }
 }
Пример #2
0
            static void ReadDataSection(AmqpMessageReader reader, AmqpMessage message)
            {
                FormatCode formatCode = reader.ReadFormatCode();

                Fx.Assert(formatCode == FormatCode.Binary8 || formatCode == FormatCode.Binary32, "Invalid binary format code");
                bool smallEncoding         = formatCode == FormatCode.Binary8;
                int  count                 = reader.ReadInt(smallEncoding);
                ArraySegment <byte> buffer = reader.ReadBytes(count);

                AmqpMessage.EnsureInitialized <List <Data> >(ref reader.dataList);
                reader.dataList.Add(new Data()
                {
                    Value = buffer
                });

                reader.AddBodyBuffer(buffer);
            }
Пример #3
0
 static void ReadAmqpSequenceSection(AmqpMessageReader reader, AmqpMessage message)
 {
     AmqpMessage.EnsureInitialized <List <AmqpSequence> >(ref reader.sequenceList);
     reader.sequenceList.Add(ReadListSection <AmqpSequence>(reader, true));
 }
Пример #4
0
 void AddBodyBuffer(ArraySegment <byte> buffer)
 {
     AmqpMessage.EnsureInitialized <List <ArraySegment <byte> > >(ref this.bodyBuffers);
     this.bodyBuffers.Add(buffer);
 }