Package 

Class BytesRange


  • @Immutable() 
    public final class BytesRange
    
                        

    A representation of the range of bytes requested or contained in a piece of content.

    This is based on the spec of the HTTP "Content-Range" header so includes methods to parse and output appropriate strings for the header.

    The header spec is at https://tools.ietf.org/html/rfc2616#section-14.16

    As per that spec, the from and to values are inclusive. Requesting the first 100 bytes of an image can be achieved by calling BytesRange.toMax(99).

    This might be useful because you want to limit the maximum size of a specific download or it might be that you already have part of the image data and only want the remainder.

    These objects are currently only respected in image requests and only taken from responses if ImagePipelineExperiments.isPartialImageCachingEnabled() is true in the image pipeline config. It is also dependent on a NetworkFetcher which writes and reads these headers.