# RangedUri

# RangedUri

Artifact:[androidx.media3:media3-exoplayer-dash](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/dash/manifest/RangedUri.java+class:androidx.media3.exoplayer.dash.manifest.RangedUri)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/RangedUri "View this page in Java")

<br />

```
@UnstableApi
class RangedUri
```

<br />

*** ** * ** ***

Defines a range of data located at a reference uri.

## Summary

|                                                                                                                                                                                                                       ### Public constructors                                                                                                                                                                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RangedUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri#RangedUri(java.lang.String,long,long))`(referenceUri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?, start: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`, length: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Constructs an ranged uri. |

|                                               ### Public functions                                               |
|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RangedUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri)`?` | [attemptMerge](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri#attemptMerge(androidx.media3.exoplayer.dash.manifest.RangedUri,java.lang.String))`(other: `[RangedUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri)`?, baseUri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Attempts to merge this[RangedUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri)with another and an optional common base uri. |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                              | [equals](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri#equals(java.lang.Object))`(obj: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                                                                                                                                                                                                                                                                   |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                      | [hashCode](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri#hashCode())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Uri](https://developer.android.com/reference/android/net/Uri.html)`!`                                           | [resolveUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri#resolveUri(java.lang.String))`(baseUri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Returns the resolved[Uri](https://developer.android.com/reference/android/net/Uri.html)represented by the instance.                                                                                                                                                                                                                                             |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                             | [resolveUriString](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri#resolveUriString(java.lang.String))`(baseUri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Returns the resolved uri represented by the instance as a string.                                                                                                                                                                                                                                                                                   |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                             | [toString](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri#toString())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

|                             ### Public properties                             |
|-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [length](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri#length()) The length of the range, or[LENGTH_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET())to indicate that the range is unbounded. |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [start](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri#start()) The (zero based) index of the first byte of the range.                                                                                                                      |

## Public constructors

### RangedUri

```
RangedUri(referenceUri: String?, start: Long, length: Long)
```

Constructs an ranged uri.  

|                                              Parameters                                              |
|------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `referenceUri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?` | The reference uri.                                                                                                                                                        |
| `start: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)               | The (zero based) index of the first byte of the range.                                                                                                                    |
| `length: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)              | The length of the range, or[LENGTH_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET())to indicate that the range is unbounded. |

## Public functions

### attemptMerge

```
fun attemptMerge(other: RangedUri?, baseUri: String!): RangedUri?
```

Attempts to merge this[RangedUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri)with another and an optional common base uri.

A merge is successful if both instances define the same[Uri](https://developer.android.com/reference/android/net/Uri.html)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: `[RangedUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri)`?` | The[RangedUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri)to merge. |
| `baseUri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                           | The base Uri.                                                                                                             |

|                                                     Returns                                                      |
|------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [RangedUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri)`?` | The merged[RangedUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/dash/manifest/RangedUri)if the merge was successful. Null otherwise. |

### equals

```
fun equals(obj: Any?): Boolean
```  

### hashCode

```
fun hashCode(): Int
```  

### resolveUri

```
fun resolveUri(baseUri: String!): Uri!
```

Returns the resolved[Uri](https://developer.android.com/reference/android/net/Uri.html)represented by the instance.  

|                                           Parameters                                            |
|-------------------------------------------------------------------------------------------------|---------------|
| `baseUri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The base Uri. |

|                                Returns                                 |
|------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html)`!` | The[Uri](https://developer.android.com/reference/android/net/Uri.html)represented by the instance. |

### resolveUriString

```
fun resolveUriString(baseUri: String!): String!
```

Returns the resolved uri represented by the instance as a string.  

|                                           Parameters                                            |
|-------------------------------------------------------------------------------------------------|---------------|
| `baseUri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The base Uri. |

|                                       Returns                                        |
|--------------------------------------------------------------------------------------|--------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The uri represented by the instance. |

### toString

```
fun toString(): String!
```  

## Public properties

### length

```
val length: Long
```

The length of the range, or[LENGTH_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET())to indicate that the range is unbounded.  

### start

```
val start: Long
```

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