title: Return a file using Java Jersey
body: <p>I am using the Java Jersey to implement a REST service.
  One thing my service should provide is a file download option.
  These files are quite big and are constructed from data from db.</p>
  
  <p>Currently I am fetching all data from the db and saving it to a file
  and returning a </p>
  
  <pre><code>Response.ok().entity(new FileInputStream(file)).build();
  </code></pre>
  
  <p>Is there a way how I can start serving the file without fully downloading the data from db, but as the data comes from db append it to the Output stream ?</p>