title: How to Implement HTTP byte-range requests in Spring MVC
body: <p>I have the problem with video rewind on my site.</p>
  
  <p>I figure out that problem with http headers.</p>
  
  <p>My current controller method which returns video:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, value = "/testVideo")
  @ResponseBody
  public FileSystemResource testVideo(Principal principal) throws IOException {
     return new FileSystemResource(new File("D:\\oceans.mp4"));
  }
  </code></pre>
  
  <p>How to rewrite following code with byte-range supporting?</p>
  
  <h2>P.S.</h2>
  
  <p>I have seen following example <a href="https://web.archive.org/web/20100818085302/http://balusc.blogspot.com/2009/02/fileservlet-supporting-resume-and.html" rel="noreferrer">http://balusc.blogspot.in/2009/02/fileservlet-supporting-resume-and.html</a></p>
  
  <p>But this code looks hard for me and I cannot understand it. I hope that in spring mvc exists way simpler.</p>