docs: @Nullable
    public static BytesRange fromContentRangeHeader(@Nullable String header)
        throws IllegalArgumentException {
      if (header == null) {
        return null;
      }
  
      if (sHeaderParsingRegEx == null) {
        sHeaderParsingRegEx = Pattern.compile("[-/ ]");
      }
  
      try {
        final String[] headerParts = sHeaderParsingRegEx.split(header);
        Preconditions.checkArgument(headerParts.length == 4);
        Preconditions.checkArgument(headerParts[0].equals("bytes"));
  
        final int from = Integer.parseInt(headerParts[1]);
        final int to = Integer.parseInt(headerParts[2]);
        final int length = Integer.parseInt(headerParts[3]);
        Preconditions.checkArgument(to > from);
        Preconditions.checkArgument(length > to);
  
        if (to < length - 1) {
          return new BytesRange(from, to);
        } else {
          return new BytesRange(from, TO_END_OF_CONTENT);
        }
      } catch (IllegalArgumentException x) {
        throw new IllegalArgumentException(
            String.format((Locale) null, "Invalid Content-Range header value: \"%s\"", header),
            x);
      }
    }