private void CopyFromReadBuffer()

in src/Util/AesGcmEncryptCachingStream.cs [179:193]


        private void CopyFromReadBuffer(byte[] buffer, ref int offset, ref int count)
        {
            var readBufferOffset = (int)(_position - _readBufferStartPosition);
            var bytesToCopy = Math.Min(_readBuffer.Count - readBufferOffset, count);
            if (bytesToCopy == 0)
            {
                return;
            }

            _readBuffer.CopyTo(readBufferOffset, buffer, offset, bytesToCopy);

            offset += bytesToCopy;
            count -= bytesToCopy;
            _position += bytesToCopy;
        }