scummvm/scummvm — pull request #259 by somaen (2012-07-18 11:59:18+00:00)
Title: COMMON: Add an argument to wrapCompressedReadStream, for streams with unknown size()

While the title might be a tad misleading I'm talking about the files that set _size=0 since we can't tell the size directly from the stream at open-time. For WME, which needs to read a few files completely, and thus needs to know how big a buffer to allocate, it is usefull to have the size available along with the stream.

The current solution I'm using in WME, is to create ANOTHER wrapper-stream, that keeps track of the size, thus ending up with a Common::File inside a Common::SeekableSubReadStream inside a Common::GZipReadStream inside my wrapper stream....

It would thus be preferable, and a tad cleaner, atleast for WME to allow the default-value here to be overriden.