This is a read analogue for the existing CVectorWriter.
For BIP158; is cherry-picked from two commits (947133d and 87f2d9e) from:
https://github.com/bitcoin/bitcoin/pull/12254/commits
In addition, the buggy seek() method was removed per later backport:
https://github.com/bitcoin/bitcoin/pull/14357