public final class ContentRangeParser extends Object
Content-Range: <unit> <range-start>-<range-end>\/<size>Content-Range: <unit> <range-start>-<range-end>\/*Content-Range: <unit> *\/<size>
The only supported <unit> is the bytes value.
| Modifier and Type | Method and Description |
|---|---|
static OptionalLong |
totalBytes(String contentRange)
Parse the Content-Range to extract the total number of byte from the content.
|
public static OptionalLong totalBytes(String contentRange)
bytes unit, any
other unit will result in an empty OptionalLong. If the total length in unknown, which is represented by a * symbol
in the header value, an empty OptionalLong will be returned.contentRange - the value of the Content-Range header to be parsed.Copyright © 2026. All rights reserved.