ServiceStack.Text.RecyclableMemoryStream.SetLength C# (CSharp) Method

SetLength() public method

Sets the length of the stream
value is negative or larger than MaxStreamLength Object has been disposed
public SetLength ( long value ) : void
value long
return void
        public override void SetLength(long value)
        {
            this.CheckDisposed();
            if (value < 0 || value > MaxStreamLength)
            {
                throw new ArgumentOutOfRangeException("value", "value must be non-negative and at most " + MaxStreamLength);
            }

            this.EnsureCapacity((int)value);

            this.length = (int)value;
            if (this.position > value)
            {
                this.position = (int)value;
            }
        }