func (t *Torrent) byteRegionPieces(off, size int64) (begin, end pieceIndex) {
	if off >= *t.length {
		return
	}
	if off < 0 {
		size += off
		off = 0
	}
	if size <= 0 {
		return
	}
	begin = pieceIndex(off / t.info.PieceLength)
	end = pieceIndex((off + size + t.info.PieceLength - 1) / t.info.PieceLength)
	if end > pieceIndex(t.info.NumPieces()) {
		end = pieceIndex(t.info.NumPieces())
	}
	return
}
// Returns the range of pieces [begin, end) that contains the extent of bytes.
Returns the range of pieces [begin, end) that contains the extent of bytes.
// Returns the range of pieces [ begin end ) that contains the extent of bytes .
func (t *Torrent) byteRegionPieces(off, size int64) (begin, end pieceIndex) {
	if off >= *t.length {
		return
	}
	if off < 0 {
		size += off
		off = 0
	}
	if size <= 0 {
		return
	}
	begin = pieceIndex(off / t.info.PieceLength)
	end = pieceIndex((off + size + t.info.PieceLength - 1) / t.info.PieceLength)
	if end > pieceIndex(t.info.NumPieces()) {
		end = pieceIndex(t.info.NumPieces())
	}
	return
}
func ( t * Torrent ) byteRegionPieces ( off , size int64 ) ( begin , end pieceIndex ) { if off >= * t . length { return } if off < 0 { size += off off = 0 } if size <= 0 { return } begin = pieceIndex ( off / t . info . PieceLength ) end = pieceIndex ( ( off + size + t . info . PieceLength - 1 ) / t . info . PieceLength ) if end > pieceIndex ( t . info . NumPieces ( ) ) { end = pieceIndex ( t . info . NumPieces ( ) ) } return }
Returns the range of pieces [begin, end) that contains the extent of bytes.
Returns the range of pieces [ begin end ) that contains the extent of bytes .