D
Daniel Oberhoff
Hello all,
I am writing a util framework to operate on matlab mat files because I
don't want to link to matlab for this and I didn't like the available
c-implementation. also i wanted to use blitz++ as the matrix
representation.
now I want to add compression support so I got a nice stl zlib iostream
wrapper from the code project, but it doesn't work. before I dive into
the gory details of debugging i wanted to check if maybe I got the
iostream concept wrong.
what I do is when I encounter a header indicating zipped data I wrap the
zistream around my fstream like this:
zistream * unzipper = new zistream(myfstream);
at this point fstream.tellg() should point to the first zipped byte and
the zistream should take it from there. now I am wondering if it is
actualy possible to wrap streams like this, "on demand", and if also
alter it is ok to do
delete unzipper;
after the zipped block is exhausted (I know how many bytes to expect)
and keep on reading from myfstream?
the zistream class, as I understand, is implemented the STL way by
reimplementing the relevant streambuf class.
Daniel
I am writing a util framework to operate on matlab mat files because I
don't want to link to matlab for this and I didn't like the available
c-implementation. also i wanted to use blitz++ as the matrix
representation.
now I want to add compression support so I got a nice stl zlib iostream
wrapper from the code project, but it doesn't work. before I dive into
the gory details of debugging i wanted to check if maybe I got the
iostream concept wrong.
what I do is when I encounter a header indicating zipped data I wrap the
zistream around my fstream like this:
zistream * unzipper = new zistream(myfstream);
at this point fstream.tellg() should point to the first zipped byte and
the zistream should take it from there. now I am wondering if it is
actualy possible to wrap streams like this, "on demand", and if also
alter it is ok to do
delete unzipper;
after the zipped block is exhausted (I know how many bytes to expect)
and keep on reading from myfstream?
the zistream class, as I understand, is implemented the STL way by
reimplementing the relevant streambuf class.
Daniel