From ripley at stats.ox.ac.uk  Wed May  2 17:21:08 2012
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 02 May 2012 16:21:08 +0100
Subject: [Rd] Decompressing raw vectors in memory
In-Reply-To: <CABdHhvHZLaGEcmuqLN-pzd_oGfJt8O_doU9JT8wvHwn=_pMyZw@mail.gmail.com>
References: <CABdHhvHZLaGEcmuqLN-pzd_oGfJt8O_doU9JT8wvHwn=_pMyZw@mail.gmail.com>
Message-ID: <4FA150E4.3090907@stats.ox.ac.uk>

On 02/05/2012 14:24, Hadley Wickham wrote:
> Hi all,
>
> I'm struggling to decompress a gzip'd raw vector in memory:
>
> content<- readBin("http://httpbin.org/gzip", "raw", 1000)
>
> memDecompress(content, type = "gzip")
> # Error in memDecompress(content, type = "gzip") :
> #  internal error -3 in memDecompress(2)
>
> I'm reasonably certain that the file is correctly compressed, because
> if I save it out to a file, I can read the uncompressed data:
>
> tmp<- tempfile()
> writeBin(content, tmp)
> readLines(tmp)
>
> So that suggests I'm using memDecompress incorrectly.  Any hints?

Headers.

> Thanks!
>
> Hadley
>


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Decompressing raw vectors in memory
Prof Brian Ripley