bytestream: add a new set of bytestream functions with overread checking