R/RcppExports.R

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Compress a raw vector
#'
#' @param r_content Raw vector of data to compress.
#' @param format A character scalar indicating the type of compression to apply.
#' This must be one of "gzip", "zlib" or "raw".
#' @return Raw vector of compressed data.
#' @export
#' @examples
#' raw <- charToRaw("The quick brown fox jumps over the lazy dog.")
#' compressed <- mem_compress(raw, format = "gzip")
#' decompressed <- mem_inflate(compressed, format = "gzip", 1000)
mem_compress <- function(r_content, format) {
    .Call('_gzmem_mem_compress', PACKAGE = 'gzmem', r_content, format)
}

#' Inflate a raw vector that was compressed
#'
#' @param r_source raw vector of compressed data.
#' @param format A character scalar indicating the type of compression that was applied.
#' This must be one of "gzip", "zlib" or "raw".
#' @param r_guess_size your best guess as to the size of uncompressed data. Not ideal,
#'        and this won't be necessary in future releases. Reember, this is a direct
#'        port from the defunct \code{Rcompression} package.\cr
#'        \cr
#'        Aim high as you'll only get back the actual number of bytes
#'        in the uncompressed data.
#' @return Raw vector of expanded data.
#' @export
#' @examples
#' raw <- charToRaw("The quick brown fox jumps over the lazy dog.")
#' compressed <- mem_compress(raw, format = "gzip")
#' decompressed <- mem_inflate(compressed, format = "gzip", 1000)
mem_inflate <- function(r_source, format, r_guess_size) {
    .Call('_gzmem_mem_inflate', PACKAGE = 'gzmem', r_source, format, r_guess_size)
}
hrbrmstr/gzmem documentation built on May 17, 2019, 5:08 p.m.