> Documentation index: https://developer.android.com/reference/llms.txt

# RangedUri

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

*** ** * ** ***


```
@UnstableApi
public final class RangedUri
```

<br />

*** ** * ** ***

Defines a range of data located at a reference uri.

## Summary

| ### Public fields |
|---|---|
| `final long` | `length` The length of the range, or `LENGTH_UNSET` to indicate that the range is unbounded. |
| `final long` | `start` The (zero based) index of the first byte of the range. |

| ### Public constructors |
|---|
| `RangedUri(@Nullable String referenceUri, long start, long length)` Constructs an ranged uri. |

| ### Public methods |
|---|---|
| `@Nullable RangedUri` | `attemptMerge(@Nullable RangedUri other, String baseUri)` Attempts to merge this `RangedUri` with another and an optional common base uri. |
| `boolean` | `equals(@Nullable 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()` |

## Public fields

### length

```
public final long length
```

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

### start

```
public final long start
```

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

## Public constructors

### RangedUri

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

Constructs an ranged uri.

| Parameters |
|---|---|
| `@Nullable String referenceUri` | The reference uri. |
| `long start` | The (zero based) index of the first byte of the range. |
| `long length` | The length of the range, or `LENGTH_UNSET` to indicate that the range is unbounded. |

## Public methods

### attemptMerge

```
public @Nullable 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 |
|---|---|
| `@Nullable RangedUri other` | The `RangedUri` to merge. |
| `String baseUri` | The base Uri. |

| Returns |
|---|---|
| `@Nullable RangedUri` | The merged `RangedUri` if the merge was successful. Null otherwise. |

### equals

```
public boolean equals(@Nullable Object obj)
```

### hashCode

```
public int hashCode()
```

### resolveUri

```
public Uri resolveUri(String baseUri)
```

Returns the resolved `Uri` represented by the instance.

| Parameters |
|---|---|
| `String baseUri` | The base Uri. |

| Returns |
|---|---|
| `Uri` | The `Uri` represented by the instance. |

### resolveUriString

```
public String resolveUriString(String baseUri)
```

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

| Parameters |
|---|---|
| `String baseUri` | The base Uri. |

| Returns |
|---|---|
| `String` | The uri represented by the instance. |

### toString

```
public String toString()
```