Package-level declarations

Types

Link copied to clipboard
class BlockInfo

Bookkeeping for one block of a downloading piece, the port of piece_picker::block_info. Only pieces that are partially downloaded keep an array of these (see DownloadingPiece); pieces we fully have or have never touched carry none.

Link copied to clipboard

The four states a single block can be in. This is a pure-Kotlin port of the anonymous enum inside libtorrent's piece_picker::block_info (include/libtorrent/piece_picker.hpp).

Link copied to clipboard
class DownloadingPiece(val index: Int, val blocks: Array<BlockInfo>)

Tracks block allocations for a single piece that is currently being downloaded. This is the port of piece_picker::downloading_piece.

Link copied to clipboard

Per-piece and per-file download priority constants. This is a pure-Kotlin port of libtorrent's download_priority.hpp.

Link copied to clipboard
data class PieceBlock(val pieceIndex: Int, val blockIndex: Int) : Comparable<PieceBlock>

Identifies a single block within a piece. This is a pure-Kotlin port of libtorrent's piece_block (include/libtorrent/piece_block.hpp).

Link copied to clipboard
class PiecePicker(numPieces: Int, blocksPerPiece: Int)

Rarest-first piece selection: a pure-Kotlin port of the core of libtorrent's piece_picker (src/piece_picker.cpp, include/libtorrent/piece_picker.hpp).

Link copied to clipboard
data class PieceStats(val peerCount: Int, val priority: Int, val have: Boolean, val downloading: Boolean)

A snapshot of one piece's high-level state, the port of piece_picker::piece_stats_t. Returned by PiecePicker.pieceStats.