Microsoft.Azure.Amqp.ByteBuffer.Append C# (CSharp) Method

Append() public method

public Append ( int size ) : void
size int
return void
        public void Append(int size)
        {
            Fx.Assert(size >= 0, "size must be positive.");
            Fx.Assert((this.write + size) <= this.end, "Append size too large.");
            this.write += size;
        }

Usage Example

Example #1
0
            public override void WriteBuffer(IList <ByteBuffer> buffers)
            {
                Fx.Assert(buffers.Count > 0, "buffers.Count should be set");
                int count = 0;

                foreach (ByteBuffer byteBuffer in buffers)
                {
                    count += byteBuffer.Length;
                }

                ByteBuffer bigBuffer = new ByteBuffer(count, false, false);

                foreach (ByteBuffer byteBuffer in buffers)
                {
                    Buffer.BlockCopy(byteBuffer.Buffer, byteBuffer.Offset, bigBuffer.Buffer, bigBuffer.Length, byteBuffer.Length);
                    bigBuffer.Append(byteBuffer.Length);

                    // Dispose incoming frame buffers since the caller is expecting us to release these objects
                    byteBuffer.Dispose();
                }

                base.WriteBuffer(bigBuffer);
            }
All Usage Examples Of Microsoft.Azure.Amqp.ByteBuffer::Append