-
public class BytesRange.Companion
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerTO_END_OF_CONTENTpublic final static BytesRange.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final BytesRangefrom(Integer from)Specifies a bytes range to request only the bytes from a specified index up to the end of the data. final BytesRangetoMax(Integer to)Specifies a bytes range to request no more than a specified number of bytes. final BytesRangefromContentRangeHeader(String header)Creates an instance of BytesRange by parsing the value of a returned HTTP "Content-Range" header. final IntegergetTO_END_OF_CONTENT()-
-
Method Detail
-
from
final BytesRange from(Integer from)
Specifies a bytes range to request only the bytes from a specified index up to the end of the data.
- Parameters:
from- the first byte to request, must be positive or zero
-
toMax
final BytesRange toMax(Integer to)
Specifies a bytes range to request no more than a specified number of bytes. If the encoded image is less than the requested maximum you may still get the entire result.
- Parameters:
to- the maximum byte to be requested, must be positive
-
fromContentRangeHeader
final BytesRange fromContentRangeHeader(String header)
Creates an instance of BytesRange by parsing the value of a returned HTTP "Content-Range" header.
If the range runs to the end of the available content, the end of the range will be set to TO_END_OF_CONTENT.
The header spec is at https://tools.ietf.org/html/rfc2616#section-14.16
-
getTO_END_OF_CONTENT
final Integer getTO_END_OF_CONTENT()
-
-
-
-