Package com.google.android.exoplayer2.source.dash.manifest

## Class RangedUri

- java.lang.Object
- - com.google.android.exoplayer2.source.dash.manifest.RangedUri

-     public final class RangedUri
      extends Object

  Defines a range of data located at a reference uri.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `long` | `length` | The length of the range, or `C.LENGTH_UNSET` to indicate that the range is unbounded.
    `long` | `start` | The (zero based) index of the first byte of the range.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `RangedUri​(String referenceUri, long start, long length)` | Constructs an ranged uri.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `RangedUri` | `attemptMerge​(RangedUri other, String baseUri)` | Attempts to merge this `RangedUri` with another and an optional common base uri.
    `boolean` | `equals​(Object obj)` |
    `int` | `hashCode()` |
    `Uri` | `resolveUri​(String baseUri)` | Returns the resolved `Uri` represented by the instance.
    `String` | `resolveUriString​(String baseUri)` | Returns the resolved uri represented by the instance as a string.
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### start

          public final long start

      The (zero based) index of the first byte of the range.

    - #### length

          public final long length

      The length of the range, or `C.LENGTH_UNSET` to indicate that the range is unbounded.

  - ### Constructor Detail

    - #### RangedUri

          public RangedUri​(@Nullable
                           String referenceUri,
                           long start,
                           long length)

      Constructs an ranged uri.
      Parameters:
        `referenceUri` - The reference uri.
        `start` - The (zero based) index of the first byte of the range.
        `length` - The length of the range, or `C.LENGTH_UNSET` to indicate that the range is unbounded.

  - ### Method Detail

    - #### resolveUri

          public Uri resolveUri​(String baseUri)

      Returns the resolved `Uri` represented by the instance.
      Parameters:
        `baseUri` - The base Uri.
      Returns:
        The `Uri` represented by the instance.

    - #### resolveUriString

          public String resolveUriString​(String baseUri)

      Returns the resolved uri represented by the instance as a string.
      Parameters:
        `baseUri` - The base Uri.
      Returns:
        The uri represented by the instance.

    - #### attemptMerge

          @Nullable
          public RangedUri attemptMerge​(@Nullable
                                        RangedUri other,
                                        String baseUri)

      Attempts to merge this `RangedUri` with another and an optional common base uri.

      A merge is successful if both instances define the same `Uri` after resolution with the base uri, and if one starts the byte after the other ends, forming a contiguous region with no overlap.

      If `other` is null then the merge is considered unsuccessful, and null is returned.

      Parameters:
        `other` - The `RangedUri` to merge.
        `baseUri` - The base Uri.
      Returns:
        The merged `RangedUri` if the merge was successful. Null otherwise.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals​(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`