Add some File method comments

This commit is contained in:
Matt Joiner 2016-03-19 17:40:30 +11:00
parent 409d3695a6
commit 125c864a8c
1 changed files with 3 additions and 0 deletions

View File

@ -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))
}