HttpRange

data class HttpRange(val url: String, val firstByte: Long, val lastByte: Long)

One HTTP byte range to fetch from a web seed: the fully-qualified url plus an inclusive [firstByte, lastByte] interval, ready to drop straight into a Range: bytes=$firstByte-$lastByte header.

This is the pure, network-free output of WebSeed.rangesFor. See that function for how a BitTorrent (piece, offset, length) request becomes a list of these.

Constructors

Link copied to clipboard
constructor(url: String, firstByte: Long, lastByte: Long)

Properties

Link copied to clipboard

First byte of the range within that file (0-based, inclusive).

Link copied to clipboard

Last byte of the range within that file (inclusive), i.e. offset + size - 1.

Link copied to clipboard

Number of bytes this range covers.

Link copied to clipboard

The HTTP/1.1 byte-range spec value, e.g. bytes=0-16383 (RFC 7233 §2.1).

Link copied to clipboard
val url: String

Absolute URL of the file this range lives in.