[Pharo-users] Problem to use GZIPReadStream

Serge Stinckwich serge.stinckwich at gmail.com
Thu Jun 7 12:07:54 EDT 2018


On Thu, Jun 7, 2018 at 4:59 PM Guillermo Polito <guillermopolito at gmail.com>
wrote:

> Hi Serge,
>
> What Pharo version are you on? What is your `file` object? If `file` is a
> FileReference, you need to know that by default, using `readStream`
> provides now an encoded file (to keep backwards compatibility with what
> most users were doing until now).
> And I think that GZip should just decode/decompress binary data.
>
> Instead of asking it for a readStream, try asking for a `binaryReadStream`.
>
> compressed := file binaryReadStream.
> stream := (GZipReadStream on: compressed) upToEnd asByteArray readStream.
>
>

​Thank you Guille, it works now :-)

-- 
Serge Stinckwich
UMI UMMISCO 209 (SU/IRD/UY1)
"Programs must be written for people to read, and only incidentally for
machines to execute."http://www.doesnotunderstand.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20180607/ede05500/attachment.html>


More information about the Pharo-users mailing list