code: func pieceEndFileIndex(pieceEndOffset int64, files []*File) int {
  	for i, f := range files {
  		if f.offset+f.length >= pieceEndOffset {
  			return i + 1
  		}
  	}
  	return 0
  }
docs: // Returns the index after the last file containing the piece. files must be
  // ordered by offset.