Applies to: Protocol and format interpretation for developers inspecting authorized media delivery.

The useful distinctions

  • Byte ranges use zero-based offsets.
  • An explicit last-byte position is inclusive.
  • A server can ignore Range and send a full 200 response.

Translate length into an endpoint

Suppose a local index says a useful block begins at byte 1024 and occupies 256 bytes. Write the desired interval as a half-open interval first: positions 1024 through just before 1280. Converting that into the HTTP spelling requires subtracting one from the exclusive upper boundary. This worksheet keeps the storage length separate from the final offset, which are easy to confuse when copying numbers between an index table and a request trace.

Check the returned interval separately

The example requests exactly 256 positions: 1279 minus 1024 plus one. That calculation is a prediction about the request, not evidence about a response. A real observation would also need the returned status, returned interval, representation identifier, and actual byte count. Treat a complete response as a different outcome rather than trimming it blindly at the requested offset. For repeated reads, retain a stable representation identifier with the index; offsets from yesterday's object may identify unrelated bytes in today's object. This is especially relevant when one path is reused for changing content. An offset ledger should retain both the inclusive HTTP endpoints and the half-open storage interval, so another reviewer can reproduce the conversion without reverse-engineering the requester's internal indexing convention.

Worked example · synthetic

The requested length is 1279 − 1024 + 1 = 256 bytes. The request is syntactically valid even though no server or object has been contacted.

Synthetic text example; no network operation has been performed.

HTTP/MIME line endings are CRLF. Request URL context, where labelled, is commentary rather than a wire field. No message was transmitted.

GET /samples/object.bin HTTP/1.1
Host: media.example.invalid
Range: bytes=1024-1279

Check the interpretation

  • Calculate end = start + length − 1.
  • Check the response rather than assuming 206.
  • Tie any offset index to a particular representation.