U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » GZDecompress bug
Re: GZDecompress bug [message #22691 is a reply to message #22687] Wed, 05 August 2009 17:17 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
luzr wrote on Wed, 05 August 2009 02:49

int GZDecompress(Stream& out, Stream& in, int size, Gate2<int, int> progress)


Here the 'size' parameter is a number of bytes to be read from in.

The size of .gz is 75 bytes, but you put there 48.



GZDecompress(index_stream, in, in.GetSize());


Thanks! That helped. I was confused by the name “size”. IMO there was no need to provide size of the input stream because it can be easily retrieved from the input stream. The only useful size I could imagine in this situation was a minimal size of the output stream (to avoid multiple reallocations).

A few lines of documentation would help me a lot in this situation.


Quote:


BTW, why MemStream? You can use 'out' as output directly without CopyStream.

Mirek


This is just a testing application. In a real application I keep uncompressed data in memory.

Another alternative to MemStream would be StringStream, but it wouldn’t let me to reserve initial buffer (what seems to be a good idea), and I’d like to avoid multiple reallocations.

Thanks a lot for your help!


Regards,
Novo
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Environment variables code page
Next Topic: ConvertInt > templatable Convert<T>
Goto Forum:
  


Current Time: Fri May 01 04:00:27 GMT+2 2026

Total time taken to generate the page: 0.00520 seconds