title: HTTP request with range
body: <p>Hey guys my assignment consists in downloading a video file from a local server using http requests, i can already do that part , but they want me to download the video by segments, that means i my requests will be partial (i will not donwload the whole file with one request), the problem is that i'm always receveing the whole file. What am i doing wrong?</p>
  
  <p>Significant part of the code:</p>
  
  <pre><code>socket = new Socket(server, port);
  OutputStream os = socket.getOutputStream();
  os.write(("GET /Lifted-" + "160" + "p.dat HTTP/1.0\r\n\r\n").getBytes());
  os.write(("Range: bytes="+Integer.toString(0)+"-"+Integer.toString((int) (bytedelay))).getBytes()); 
  </code></pre>
  
  <p>A sysoutprint of the range request:</p>
  
  <pre><code>Range: bytes=0-1089889
  </code></pre>
  
  <p>The header of the http response:   </p>
  
  <pre><code>Last-Modified: Tue, 25 Nov 2014 15:08:03 GMT
  Connection: close
  Date: Fri, 05 Dec 2014 21:12:31 GMT
  Server: Pygmy
  Content-Length: 54518444 (whole file)
  Content-Type: application/octet-stream
  </code></pre>