title: How to stream large csv in Spring4 rest api?
body: <p>I am using spring 4 web-mvc to create a rest api. I have a gigantic csv file that I want to stream. In python I can do very simple:</p>
  
  <pre><code>from flask import Response
  
  @app.route('/large.csv')
  def generate_large_csv():
      def generate():
          for row in iter_all_rows():
              yield ','.join(row) + '\n'
      return Response(generate(), mimetype='text/csv')
  </code></pre>
  
  <p>What is the equivalent in Spring 4? Is this possible?</p>