public class Range extends Object
Class specifying a range-request is being made. Request mostly follows https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35, except only one range is allowed. For the purposes of the SDK, three types of requests are supported:
Also used to represent the range returned by the server (including the full content length, if known).
Modifier and Type | Method and Description |
---|---|
Long |
getContentLength()
The content length as returned by the server, or null if unknown.
|
Long |
getEndByte()
The end byte, if given.
|
Long |
getStartByte()
The start byte, if given.
|
static Range |
parse(String value)
Parse the “content-range” header per https://tools.ietf.org/html/rfc7233#section-4.2.
|
String |
toString() |
@ConstructorProperties(value={"startByte","endByte"}) public Range(Long startByte, Long endByte)
public static Range parse(String value)
Parse the “content-range” header per https://tools.ietf.org/html/rfc7233#section-4.2.
Note, this is only for successful responses (206). It does not handle 416 (range not satisfiable).
value
- The response header value.public Long getStartByte()
The start byte, if given.
public Long getEndByte()
The end byte, if given.
public Long getContentLength()
The content length as returned by the server, or null if unknown.
Copyright © 2016–2024. All rights reserved.