public static ByteRange fromOffsetRange(long startOffset, long endOffset) {
    if (startOffset < 0 || endOffset < startOffset) {
      throw new IllegalArgumentException(
          "Invalid range offsets provided for ByteRange; startOffset=" + startOffset + ", endOffset=" + endOffset);
    }
    return new ClosedRange(startOffset, endOffset);
  }
Construct a range from a start offset to an end offset.
@param startOffset the (inclusive) start byte offset.
@param endOffset the (inclusive) end byte offset.
@return A {@link ByteRange} with the specified offsets.
@throws IllegalArgumentException if the start offset is less than 0, or the end offset is less than the start.
ambry-api/src/main/java/com/github/ambry/router/ByteRanges.java