Implement parseByteRange(header, size) for a download service. Accept one RFC-style byte range in these forms: bytes=start-end, bytes=start-, or bytes=-suffixLength.
Return an inclusive { start, end, length }, clamping an explicit end past the resource size. Reject malformed syntax, multiple ranges, non-integer/negative values, zero suffixes, empty resources, starts beyond the resource, and reversed ranges with RangeNotSatisfiable. The parser must not accept trailing junk.