code: private long getNextByteIndex(String rangeHeader) {
      if (rangeHeader == null) {
        return 0L;
      }
      return Long.parseLong(rangeHeader.substring(rangeHeader.indexOf('-') + 1)) + 1;
    }
docs: Returns the next byte index identifying data that the server has not yet received, obtained
  from the HTTP Range header (E.g a header of "Range: 0-55" would cause 56 to be returned).
  <code>null</code> or malformed headers cause 0 to be returned.
  
  @param rangeHeader in the HTTP response
  @return the byte index beginning where the server has yet to receive data