I am trying to create a c++ ostream for educational reasons. My test will be creating an ostream that acts like a ofstream would except instead of writing to a file it would
I'll just remark that you don't have to write an ostream-like class for that. You can use an adapter to achieve your goal.
For example, this code reads from istream and inserts each element into a vector:
vector V; copy(istream_iterator(cin), istream_iterator(), back_inserter(V));