From: Matt Joiner Date: Sat, 19 Mar 2016 06:40:30 +0000 (+1100) Subject: Add some File method comments X-Git-Tag: v1.0.0~829 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=125c864a8cdc5bec0b3ab2c36c2f46cca4476f23;p=btrtrc.git Add some File method comments --- diff --git a/file.go b/file.go index 41767e66..7c8a79bb 100644 --- a/file.go +++ b/file.go @@ -75,10 +75,13 @@ func (f *File) State() (ret []FilePieceState) { return } +// Requests that all pieces containing data in the file be downloaded. func (f *File) Download() { f.t.DownloadPieces(f.t.torrent.byteRegionPieces(f.offset, f.length)) } +// Requests that torrent pieces containing bytes in the given region of the +// file be downloaded. func (f *File) PrioritizeRegion(off, len int64) { f.t.DownloadPieces(f.t.torrent.byteRegionPieces(f.offset+off, len)) }