loadZip: Read the contents of a file as binary into a raw vector.

Description Usage Arguments Value Author(s) See Also Examples

Description

We use this function to read the contents of a zip file into memory. This is a general function and can be used to read arbitrary files, including any binary file. It determines the length of the file and reads that many bytes and so removes the need for the caller of readBin to know how many bytes are in the file.

Usage

1
2
readBinaryFile(filename)
loadZip(filename)

Arguments

filename

the full path identifying the file

Value

A raw vector with length corresponding to the number of bytes in the file.

Author(s)

Duncan Temple Lang

See Also

readBin

Examples

1
2
3
  data = loadZip(system.file("sampleData", "Empty.docx", package = "Rcompression"))
  ar = zipArchive(data)
  names(ar)

statwonk/Rcompression documentation built on May 30, 2019, 10:43 a.m.