title: Spring Boot File Download with Range header (partial download)
body: <p>I am developing Spring Boot Rest service for file download (either complete file or in ranges) The request from the controller is passed on to the service layer where i do processing on the file and have to return it. </p>
  
  <p>Option 1: 
  I could read the FileInputStream Byte by Byte and write it directly to output stream. But in that option, i will have to pass the response object to service layer, which i dont want to do(as service layer should be decoupled from web components). </p>
  
  <p>Option 2:
  Passing the entire byte array from service layer to controller might also not be a good option as i am dealing with very large files. </p>
  
  <p>Option 3: 
  In case of returning the entire file, i could pass the FileInputStream to ResponseEntity and spring can take care of streaming but i also
  need to address the case where i return a range of bytes from the file depending on the Range header. </p>
  
  <p>Any inputs or direction with respect to this will be very helpful. Let me know if more information is required. </p>