If you have space and there's any structure left near the ends, the easiest way is to not replace the existing rafters and joists, but to sister a second board on the side of each. Attaching the two with bolts every foot or two (50 cm). Use several bolts at the ends of the wider lumber (7x2).
If you don't have the space or the existing structure has rotted to the point that it won't hold a bolt, then a temporary support is very similar to the existing structure, built as close as possible to location you're working on. If there is a load bearing joint above your structure (unlikely for where you're working, this is typically seen with a load bearing wall and two joists meeting over top of the wall), you would build support for each side of the joint. If the existing structure has sagged, you'll want to jack it back up before installing your new support.
Note that when it comes to engineered joists and rafters, they are frequently designed with precisely engineered joints and webbing to carry the load. If you cannot match exactly what was done before, then I would recommend getting a professional, or at least the advice of an engineer.
Presuming this is the area from How two install hardwood floors in a long room with a subfloor that has a plane change in the middle? It really should be rot from being unprotected against the moist brick, which looks the same as termite damage...unless you found dead or live termites of course. Future instances can be avoided with just a Zip-lock type freezer bag over the beam's end.
But, No on the anchor idea, just not strong nor uniform enough. And No, on the iLikeDirt idea, it separates the floor from the structure. If you can't just shim them & leave sleeping dogs lie. Then, get a carpenter to get their thoughts on threat level of leaving them & what's proper &/or legal in your area for a repair.
Now, if you're lucky see if you have slots instead of pockets, this you can work with to get new beams in. Meaning, can you see the full pocket & a subfloor gap or does the subfloor seem to go into the brick? ![Lucky](https://i.stack.imgur.com/jv8gZ.jpg)
If no, then one very successful (& proper & legal around me) method is to put or leave full depth scabs in the pockets. ![PocketScabs](https://i.stack.imgur.com/W3tir.jpg)
And, those get end-lagged into & through your new ledger, which is actually a whole new floor frame. ![ScabConnect](https://i.stack.imgur.com/Yyxt8.jpg)
Just to kind of give you another view of the practice of framing in a new floor structure with old &/or new lumber. It looks something like this with the scabs being on the backside of the ledger or the light wood (it's a bad & wrong picture, but the best basic visual I could find). ![NewFrame](https://i.stack.imgur.com/JbqdG.jpg)
You would supplement the lags with upside down joist hangers on top of the scabs, since lags don't have the full shear resistance of a 2x8. Again, just for your visual understanding if the carpenter starts explaining what he'd do & it happens to sound like this. Or, see what he thinks of this, him falling down laughing would be explanation enough.
The benefits of the above method is that nothing changes, the pockets keep doing what they've done, the structure remains braced, no damage is done to any brick in trying to coax new beams in that may be too long & outwardly stress the structure & the new ledgers & joists can be custom heighted. But, hopefully the carpenter's just fine with leaving them in.
Best Answer
Yes, but a few feet longer than the defect on either side. If you were to look at all of your joist, this is probably only one of many that would have a similar defect.