Hi, I asked a question yesterday but no one answered, I will try again.
Anyone use stream_filter_append, specifically to decompress zlib-compressed
data? I'm trying to use it on a section of data in a file, but I don't know
if that's possible. Most of my file is made up of normal bytes which I read
with fread. When I get to the part which is zlib-compressed, I try to attach
the zlib filter and read my bytes. But I get the error:
stream_filter_append() [<a
href='function.stream-filter-append'>function.stream-filter-append</a>]:
Filter failed to process pre-buffered data. Not adding to filterchain.
I called stream_get_filters and zlib is present, as a filter. I am just
wondering about that pre-buffered data. What is that, do I need to worry
about it? Here are the calls I make to read from the file once I get to the
part that is compressed:
$zlib_filter = stream_filter_append($cellfile, 'zlib.inflate',
STREAM_FILTER_READ, 1);
$data = fread($cellfile, $thumblength);
stream_filter_remove($zlib_filter);
I really appreciate any pointers anyone has!
B