code: func (impl *repoImpl) packageReader(c context.Context, ref *api.ObjectRef) (*processing.PackageReader, error) {
  	// Get slow Google Storage based ReaderAt.
  	rawReader, err := impl.cas.GetReader(c, ref)
  	switch code := grpc.Code(err); {
  	case code == codes.NotFound:
  		return nil, errors.Annotate(err, "package instance is not in the storage").Err()
  	case code != codes.OK:
  		return nil, errors.Annotate(err, "failed to open the object for reading").Tag(transient.Tag).Err()
  	}
  
  	// Read in 512 Kb chunks, keep 2 of them buffered.
  	pkg, err := processing.NewPackageReader(
  		iotools.NewBufferingReaderAt(rawReader, 512*1024, 2),
  		rawReader.Size())
  	if err != nil {
  		return nil, errors.Annotate(err, "error when opening the package").Err()
  	}
  	return pkg, nil
  }
docs: // packageReader opens a package instance for reading.