ResumeData
Fast-resume (de)serialisation: the pure-Kotlin port of libtorrent's write_resume_data() (src/write_resume_data.cpp) and read_resume_data() (src/read_resume_data.cpp).
Resume data is a bencoded dictionary tagged "file-format" = "libtorrent resume file" that captures everything needed to re-add a torrent without re-checking it: the info-hash(es), the embedded info dictionary (when metadata is present), the pieces bitmask, partially-downloaded pieces, trackers, web seeds, peers, priorities, accumulated stats and the torrent flags. write produces those bytes from an AddTorrentParams; read parses them back into one.
The field names and value encodings are byte-for-byte those libtorrent uses, so a file written here can be loaded by libtorrent and vice versa. For example, the pieces string is one byte per piece with bit 0 = "have" and bit 1 = "verified", and a peer list is the concatenation of address-bytes ++ big-endian-uint16-port.
Scope: everything in the C++ functions for the non-deprecated build (TORRENT_ABI_VERSION != 1, share-mode and super-seeding enabled, i2p disabled) is reproduced, including the v2 merkle-tree trees key (each entry a { "hashes", "verified", "mask" } dict), the DHT bootstrap nodes list and a complete_sent flag.
Properties
Functions
Parse fast-resume buffer into an AddTorrentParams: the port of the throwing read_resume_data(span<char const>, ...) overload. Throws TorrentException on a malformed or non-resume buffer (wrong/absent file-format tag, missing info-hash, or a mismatching embedded info dict).
Parse an already-decoded resume-data node: the port of read_resume_data(bdecode_node const&, ...).
Serialise atp to fast-resume bytes: the port of write_resume_data_buf (bencode(write_resume_data(atp))).