Amqp.ByteBuffer.AdjustPosition C# (CSharp) 메소드

AdjustPosition() 공개 메소드

Adjusts the read and write position.
public AdjustPosition ( int offset, int length ) : void
offset int Read position to set.
length int Length from read position to set the write position.
리턴 void
        public void AdjustPosition(int offset, int length)
        {
            Fx.Assert(offset >= this.start, "Invalid offset!");
            Fx.Assert(offset + length <= this.end, "length too large!");
            this.read = offset;
            this.write = this.read + length;
        }

Usage Example

예제 #1
0
        internal uint Send(Sender sender, Message message, bool settled)
        {
            ByteBuffer buffer = new ByteBuffer(128, true);

            buffer.AdjustPosition(TransferFramePrefixSize, 0);   // reserve space for frame header and transfer
            message.Encode(buffer);

            while (buffer.Length > 0)
            {
                this.Wait(o => ((Client)o).outWindow == 0, this, 60000);
                lock (this)
                {
                    this.nextOutgoingId++;
                    if (this.outWindow < uint.MaxValue)
                    {
                        this.outWindow--;
                    }
                }

                int payload = this.WriteTransferFrame(sender.Handle, this.deliveryId, settled, buffer, this.maxFrameSize);
                Fx.DebugPrint(true, 0, "transfer", new List {
                    this.deliveryId, settled, payload
                }, "delivery-id", "settled", "payload");
            }

            return(this.deliveryId++);
        }
All Usage Examples Of Amqp.ByteBuffer::AdjustPosition