@UnstableApi
class RangedUri


Defines a range of data located at a reference uri.

Summary

Public constructors

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

Constructs an ranged uri.

Public functions

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

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

Boolean
equals(obj: Any?)
Int
Uri!
resolveUri(baseUri: String!)

Returns the resolved Uri represented by the instance.

String!

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

String!

Public properties

Long

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

Long

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?

The reference uri.

start: Long

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

length: Long

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

Public functions

attemptMerge

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

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: RangedUri?

The RangedUri to merge.

baseUri: String!

The base Uri.

Returns
RangedUri?

The merged 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 represented by the instance.

Parameters
baseUri: String!

The base Uri.

Returns
Uri!

The Uri represented by the instance.

resolveUriString

fun resolveUriString(baseUri: String!): String!

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

Parameters
baseUri: String!

The base Uri.

Returns
String!

The uri represented by the instance.

toString

fun toString(): String!

Public properties

length

val lengthLong

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

start

val startLong

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