| komp_decompress | R Documentation |
Decompress a raw vector
komp_decompress(
x,
codec = "auto",
max_output = getOption("zukomp.max_output", 1024^3),
max_ratio = getOption("zukomp.max_ratio", NULL)
)
x |
A raw vector holding a complete compressed stream. |
codec |
Codec name, as listed in |
max_output |
Refuse to produce more than this many bytes. Defaults
to 1 GiB, overridable with |
max_ratio |
Refuse to expand by more than this factor. |
A raw vector.
komp_compress(), komp_codecs()
z <- komp_compress(charToRaw(strrep("data ", 200)), "gzip")
rawToChar(komp_decompress(z, "gzip"))
# a small input that would expand a long way is stopped, not allocated
bomb <- komp_compress(raw(1e6), "gzip")
length(bomb)
try(komp_decompress(bomb, "gzip", max_output = 1024))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.