4 Info *Info // Can we embed the fields here instead, or is it something to do with saving memory?
10 func (p Piece) Length() int64 {
11 if int(p.i) == p.Info.NumPieces()-1 {
12 return p.Info.TotalLength() - int64(p.i)*p.Info.PieceLength
14 return p.Info.PieceLength
17 func (p Piece) Offset() int64 {
18 return int64(p.i) * p.Info.PieceLength
21 func (p Piece) Hash() (ret Hash) {
22 copy(ret[:], p.Info.Pieces[p.i*HashSize:(p.i+1)*HashSize])
26 func (p Piece) Index() pieceIndex {