Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 1430
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: Wed May 14 16:51:51 CEST 2025

Total time taken to generate the page: 0.02362 seconds