Amqp.ByteBuffer.Reset C# (CSharp) Method

Reset() public method

Resets read and write position to the initial state.
public Reset ( ) : void
return void
        public void Reset()
        {
            this.read = this.start;
            this.write = this.start;
        }

Usage Example

Example #1
0
            static int ReceiveFromBuffer(ByteBuffer byteBuffer, byte[] buffer, int offset, int count)
            {
                int len = byteBuffer.Length;

                if (len <= count)
                {
                    Buffer.BlockCopy(byteBuffer.Buffer, byteBuffer.Offset, buffer, offset, len);
                    byteBuffer.Reset();
                    return(len);
                }
                else
                {
                    Buffer.BlockCopy(byteBuffer.Buffer, byteBuffer.Offset, buffer, offset, count);
                    byteBuffer.Complete(count);
                    return(count);
                }
            }
All Usage Examples Of Amqp.ByteBuffer::Reset