Just have a simply number of bytes argument to avoid a lot of complexity.
Most streams are backed by a memory buffer. Create common base classes for this functionality to avoid code duplication.