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

loadZipR Documentation

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

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

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

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

omegahat/Rcompression documentation built on Nov. 29, 2023, 12:45 a.m.