code: func ReadFrom(r io.Reader) (*Index, error) {
  	var (
  		idx   Index
  		magic [4]byte
  		err   error
  	)
  	err = binary.Read(r, binary.LittleEndian, &magic)
  	if err != nil {
  		return nil, err
  	}
  	if magic != tbiMagic {
  		return nil, errors.New("tabix: magic number mismatch")
  	}
  
  	var n int32
  	err = binary.Read(r, binary.LittleEndian, &n)
  	if err != nil {
  		return nil, err
  	}
  	if n == 0 {
  		return nil, nil
  	}
  
  	err = readTabixHeader(r, &idx)
  	if err != nil {
  		return nil, err
  	}
  	if len(idx.refNames) != int(n) {
  		return nil, fmt.Errorf("tabix: name count mismatch: %d != %d", len(idx.refNames), n)
  	}
  	idx.nameMap = make(map[string]int)
  	for i, n := range idx.refNames {
  		idx.nameMap[n] = i
  	}
  
  	idx.idx, err = internal.ReadIndex(r, n, "tabix")
  	if err != nil {
  		return nil, err
  	}
  	return &idx, nil
  }
docs: // ReadFrom reads the tabix index from the given io.Reader. Note that
  // the tabix specification states that the index is stored as BGZF, but
  // ReadFrom does not perform decompression.