Skip to contents

Class representing a Blosc compressor

Format

R6::R6Class inheriting from Codec.

Details

Blosc compressor for Zarr

Super class

pizzarr::Codec -> BloscCodec

Public fields

cname

(character(1))
The compression algorithm to use.

clevel

(integer(1))
The compression level.

shuffle

(logical(1) | integer(1))
The shuffle filter to use.

blocksize

(integer(1) | NA)
The block size.

Methods


Method new()

Create a new Blosc compressor.

Usage

BloscCodec$new(cname = "lz4", clevel = 5, shuffle = TRUE, blocksize = NA, ...)

Arguments

cname

(character(1))
The compression algorithm to use.

clevel

(integer(1))
The compression level.

shuffle

(logical(1) | integer(1))
The shuffle filter to use.

blocksize

(integer(1) | NA)
The block size.

...

Not used.

Returns

A new BloscCodec object.


Method encode()

Compress data.

Usage

BloscCodec$encode(buf, zarr_arr)

Arguments

buf

(raw())
The un-compressed data.

zarr_arr

(ZarrArray)
The ZarrArray instance.

Returns

Compressed data.


Method decode()

Decompress data.

Usage

BloscCodec$decode(buf, zarr_arr)

Arguments

buf

(raw())
The compressed data.

zarr_arr

(ZarrArray)
The ZarrArray instance.

Returns

Un-compressed data.


Method get_config()

Get codec configuration as a list.

Usage

BloscCodec$get_config()

Returns

A named list.


Method clone()

The objects of this class are cloneable with this method.

Usage

BloscCodec$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.