hi,
well my question may be very basic but can u help me
I have a buffer that including my data which is binary data and I want to use the iostream to handle the buffer read/write, seek ... etc,
I am using the strstream to do this, by setting the ios::binary
and ios::in
and
ios::out
flag I have no problem and the code works fine,
yet my code is very slow because each time I want to access a line from my data I have to use the strstream.write and .read although I have a buffer that already contains my data, I tried to get around this by using the strstream constructor identifying the pointer to the existing buffer, the buffer width and approbriat ios::flags
, although that this actually make the base pointer points at my buffer but the problem that internal pointers are not updated with the width so when I try to read from the buffer it is assumed to be empty and no read operation can happen .. I want to know if there is a way around this by accessing the internal registers through which I can update the flags with the width so I can easily read from the buffer.
I would be glad if you have any other ideas that can help me improve the speed