code: func (f *fragment) ReadFrom(r io.Reader) (n int64, err error) {
  	f.mu.Lock()
  	defer f.mu.Unlock()
  
  	tr := tar.NewReader(r)
  	for {
  		// Read next tar header.
  		hdr, err := tr.Next()
  		if err == io.EOF {
  			break
  		} else if err != nil {
  			return 0, errors.Wrap(err, "opening")
  		}
  
  		// Process file based on file name.
  		switch hdr.Name {
  		case "data":
  			if err := f.readStorageFromArchive(tr); err != nil {
  				return 0, errors.Wrap(err, "reading storage")
  			}
  		case "cache":
  			if err := f.readCacheFromArchive(tr); err != nil {
  				return 0, errors.Wrap(err, "reading cache")
  			}
  		default:
  			return 0, fmt.Errorf("invalid fragment archive file: %s", hdr.Name)
  		}
  	}
  
  	return 0, nil
  }
docs: // ReadFrom reads a data file from r and loads it into the fragment.