From hadley at rice.edu  Wed May  2 15:24:21 2012
From: hadley at rice.edu (Hadley Wickham)
Date: Wed, 2 May 2012 13:24:21 +0000
Subject: [Rd] Decompressing raw vectors in memory
Message-ID: <CABdHhvHZLaGEcmuqLN-pzd_oGfJt8O_doU9JT8wvHwn=_pMyZw@mail.gmail.com>

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?

Thanks!

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



[Rd] Decompressing raw vectors in memory
Hadley Wickham