code: public static long[] parseRange(String rangeValue) {
  		int phyphen = rangeValue.indexOf('-');
  		if (phyphen == -1) {
  			// this is a syntax error.
  			return null;
  		}
  		try {
  			if (phyphen == 0) {
  				// -N (suffix-byte-range-spec)
  				long end = Long.parseLong(rangeValue.substring(1));
  				if (end <= 0) return null;
  				return new long[] { -end, -1 };
  			}
  			if (phyphen == rangeValue.length() - 1) {
  				// M- (byte-range-spec without last-byte-pos)
  				long start = Long.parseLong(rangeValue.substring(0, phyphen));
  				return new long[] { start, -1 };
  			}
  			// M-N (byte-range-spec)
  			long start = Long.parseLong(rangeValue.substring(0, phyphen));
  			long end = Long.parseLong(rangeValue.substring(phyphen + 1));
  			if (start > end) return null;
  			return new long[] { start, end + 1 };
  		} catch (NumberFormatException ex) {
  			return null;
  		}
  	}
docs: Parse single byte-range-spec.
  For suffix-byte-range-spec (-N), return [-N, -1].
  For byte-range-spec without last-byte-pos (M-), return [M, -1].
  For full-range-spec (M-N), return [M, N + 1].
  @param rangeValue byte-range-spec
  @return long[2], or {@code null} if invalid