code: private long[] getRangesFromHeader(String rangeHeader) {
          LOG.debug("Range header: {}", rangeHeader);
          long[] result = new long[2];
          final String headerPrefix = "bytes=";
          if (StringUtils.startsWith(rangeHeader, headerPrefix)) {
              String[] splitRange = rangeHeader.substring(headerPrefix.length()).split("-");
              try {
                  result[0] = Long.parseLong(splitRange[0]);
                  if (splitRange.length > 1) {
                      result[1] = Long.parseLong(splitRange[1]);
                  }
                  if (result[0] < 0 || (result[1] != 0 && result[0] > result[1])) {
                      throw new RangeException();
                  }
              } catch (NumberFormatException nfe) {
                  throw new RangeException();
              }
          }
          return result;
      }
docs: Extracts the request range header if present.
  
  @param rangeHeader
  Range header.
  @return a long[] which will always be the size 2. The first element is
  the start index, and the second the end index. If the end index
  is not set (which means till the end of the resource), 0 is
  returned in that field.