0

I need to handle the Range header programatically in Java for supporting media files on iOS.

If my file is 23843 bytes, for example, I'm getting a request with a range header:

Range: bytes 23842-23842

What am I meant to return in this case? Is it just the last byte of the file?

1 Answer 1

1

You should send the file from offset 23842 to offset 23842, so yes, that comes out as one byte.

The spec actually gives a similar example:

  • The first and last bytes only (bytes 0 and 9999): bytes=0-0,-1

(The important bit here being that 0-0 = first byte)

Sign up to request clarification or add additional context in comments.

2 Comments

Interestingly, iOS makes a request for 0-1 as the first request which is also the first bit. That's what threw me off.
0-1 are the first two bytes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.