I'm trying to have an object to store and retrieve data directly into-from memory.
I'd like to use iostream but it aks me for a streambuf.
All the examples I see using a filebuf as streambuf, but I want to work on memory.
Only at the beginning of my input and the end of output operations I'd want to read-write from-to a file.

Initially I want to solve this problem using standard io library.

I want to :
1.- Reserve or allocate a byte buffer. (really I want to create a vector of byte buffers...)
2. Write data to it ( any kind )
3.- Write buffers to file ( using the rdbuf ?)

By now, I cant do nothing.
'Cout' can work but I want to have my own iostream.

I used in the past the java datastream and an array of bytebuffers

But I'm unable to do the same with standard C++ (But I think that it is possible)


Can anybody help me ? I'm really lost.