InMemoryDiskIo
A DiskIo that keeps the whole torrent in one in-memory buffer. The BitTorrent piece model treats the files as a single concatenated byte stream, so piece p lives at p * pieceLength within that stream, which is exactly this buffer. Per-file boundaries only matter when writing to real files (FileDiskIo); here one buffer is the simplest correct model.
This is the engine's test workhorse: deterministic, no I/O, no platform deps.
Properties
Functions
Link copied to clipboard
Which pieces do we already have on disk? Drives the initial resume/recheck.
Link copied to clipboard
Hash a fully-downloaded piece for verification against the torrent's hashes.
Link copied to clipboard