Amqp.ByteBuffer.Complete C# (CSharp) Method

Complete() public method

Advances the read position.
public Complete ( int size ) : void
size int Size to advance.
return void
        public void Complete(int size)
        {
            Fx.Assert(size >= 0, "size must be positive.");
            Fx.Assert((this.read + size) <= this.write, "Complete size too large.");
            this.read += size;
        }

Usage Example

 /// <summary>
 /// Reads a signed byte and advance the buffer read cursor.
 /// </summary>
 /// <param name="buffer">The buffer to read from.</param>
 /// <returns></returns>
 public static sbyte ReadByte(ByteBuffer buffer)
 {
     buffer.Validate(false, FixedWidth.UByte);
     sbyte data = (sbyte)buffer.Buffer[buffer.Offset];
     buffer.Complete(FixedWidth.UByte);
     return data;
 }
All Usage Examples Of Amqp.ByteBuffer::Complete