code: func (f *File) State() (ret []FilePieceState) {
  	f.t.cl.rLock()
  	defer f.t.cl.rUnlock()
  	pieceSize := int64(f.t.usualPieceSize())
  	off := f.offset % pieceSize
  	remaining := f.length
  	for i := pieceIndex(f.offset / pieceSize); ; i++ {
  		if remaining == 0 {
  			break
  		}
  		len1 := pieceSize - off
  		if len1 > remaining {
  			len1 = remaining
  		}
  		ps := f.t.pieceState(i)
  		ret = append(ret, FilePieceState{len1, ps})
  		off = 0
  		remaining -= len1
  	}
  	return
  }
docs: // Returns the state of pieces in this file.