code: func (d *Decoder) Decode(idx *Index) error {
  	var err error
  	idx.Version, err = validateHeader(d.r)
  	if err != nil {
  		return err
  	}
  
  	entryCount, err := binary.ReadUint32(d.r)
  	if err != nil {
  		return err
  	}
  
  	if err := d.readEntries(idx, int(entryCount)); err != nil {
  		return err
  	}
  
  	return d.readExtensions(idx)
  }
docs: // Decode reads the whole index object from its input and stores it in the
  // value pointed to by idx.