Пример #1
0
 private void CheckDisposed()
 {
     if (this.response == null)
     {
         Error.ThrowObjectDisposed(this.GetType());
     }
 }
 private void AssertOpen()
 {
     if (null == this.reader)
     {
         Error.ThrowObjectDisposed(this.GetType());
     }
 }
            public override int Read(byte[] buffer, int offset, int count)
            {
                if (null == this.Target)
                {
                    Error.ThrowObjectDisposed(this.GetType());
                }

                int result = this.Target.ReadDelimiter(buffer, offset, count);

                return(result);
            }
            public override int Read(byte[] buffer, int offset, int count)
            {
                if (null == this.target)
                {
                    Error.ThrowObjectDisposed(this.GetType());
                }

                int result = this.target.ReadLength(buffer, offset, Math.Min(count, this.length));

                this.length -= result;
                Debug.Assert(0 <= this.length, "Read beyond expected length");
                return(result);
            }