This switches .read() and .write() to take spans of bytes.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/23438 | core#23438]]
https://github.com/bitcoin/bitcoin/pull/23438/commits/fa24493d6394b3a477535f480664c9596f18e3c5
Depends ib D15934