About iostream and buffers and arrays and vectors and the ways to communicate all of them

I dont know how to do the work:
Basically I want to have a method to 'fill'and retrieve memory data using buffers .( char or byte buffers ).
I want to read and write blocks of 65536 bytes (for example) with data to-from vectors, fixed arrays, etc.
I want to do this to files and into memory.

I dont know if the way is to use the iostream, the streambuf ...
It seems that I can do something with the << and >> operators, but I cant get it.
I am very confused.

As a little example:
I have a vector of doubles and I'd like to transform it to a buffer or vector of buffers. I'd want to write it to a file and later do the 'mirror' operation, read a buffer and transform it to a vector.

So ...
I'd like to have something like :
mybuf<<myvector;
mybuf<<a_double;
write mybuf to a bin file
read mybuf from a bin file
mybuf>>myvector;
mybuf>>a_double;

I hope that you understand me....
Thanks,.








Topic archived. No new replies allowed.