compressobj {zlib}R Documentation

Create a Compression Object

Description

compressobj initializes a new compression object with specified parameters and methods. The function makes use of publicEval to manage scope and encapsulation.

Usage

compressobj(
             level = -1,
             method = zlib$DEFLATED,
             wbits = zlib$MAX_WBITS,
             memLevel = zlib$DEF_MEM_LEVEL,
             strategy = zlib$Z_DEFAULT_STRATEGY,
             zdict = NULL
         )

Arguments

level

Compression level, default is -1.

method

Compression method, default is zlib$DEFLATED.

wbits

Window bits, default is zlib$MAX_WBITS.

memLevel

Memory level, default is zlib$DEF_MEM_LEVEL.

strategy

Compression strategy, default is zlib$Z_DEFAULT_STRATEGY.

zdict

Optional predefined compression dictionary as a raw vector.

Value

Returns an environment containing the public methods compress and flush.

Methods

Examples

compressor <- compressobj(level = 6)
compressed_data <- compressor$compress(charToRaw("some data"))
compressed_data <- c(compressed_data, compressor$flush())


[Package zlib version 1.0.3 Index]