System.Net.Http.ResponseStream.Write C# (CSharp) Method

Write() public method

public Write ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
return void
        public override void Write(byte[] buffer, int offset, int count)
        {
            VerifyBuffer(buffer, offset, count, allowEmpty: true);
            CheckDisposed();

            _writeLock.Wait();
            try
            {
                FirstWrite();
                if (count == 0)
                {
                    return;
                }
                // Copies are necessary because we don't know what the caller is going to do with the buffer afterwards.
                var internalBuffer = new byte[count];
                Buffer.BlockCopy(buffer, offset, internalBuffer, 0, count);
                _bufferedData.Enqueue(internalBuffer);

                SignalDataAvailable();
            }
            finally
            {
                _writeLock.Release();
            }
        }