code: func (r *reader) available(off, max int64) (ret int64) {
  	off += r.offset
  	for max > 0 {
  		req, ok := r.t.offsetRequest(off)
  		if !ok {
  			break
  		}
  		if !r.t.haveChunk(req) {
  			break
  		}
  		len1 := int64(req.Length) - (off - r.t.requestOffset(req))
  		max -= len1
  		ret += len1
  		off += len1
  	}
  	// Ensure that ret hasn't exceeded our original max.
  	if max < 0 {
  		ret += max
  	}
  	return
  }
docs: // How many bytes are available to read. Max is the most we could require.