title: How to figure out if range is allowed without accept-ranges header
body: <p>I'm trying to create a multi-threaded downloader application. For this, I get <code>InputStream</code>s like this:</p>
  
  <pre><code>URLConnection cn = new URL(str).openConnection();
  cn.setRequestProperty("Range", "bytes=" + first + "-" + last);
  cn.connect();
  cn.getInputStream();
  </code></pre>
  
  <p>I check <code>Accept-Ranges</code> header if it is allowed to request a part of the file. I've found that <code>Accept-Ranges: none</code> means it's not allowed, but sometimes the header doesn't even contain <code>Accept-Ranges</code> field. Are there any other ways to check if the connection supports ranges? For example checking if the length of returned part is equal to <code>last - first + 1</code> or not?</p>