The Zarr "blosc" codec offers a number of compression options to reduce the size of a raw vector prior to storing, and uncompressing when reading.
zarr::zarr_extension -> zarr::zarr_codec -> zarr_codec_blosc
cnameSet or retrieve the name of the compression algorithm. Must be one of "blosclz", "lz4", "lz4hc", "zstd" or "zlib".
clevelSet or retrieve the compression level. Must be an integer between 0 (no compression) and 9 (maximum compression).
shuffleSet or retrieve the data shuffling of the compression algorithm. Must be one of "shuffle", "noshuffle" or "bitshuffle".
typesizeSet or retrieve the size in bytes of the data type being compressed. It is highly recommended to leave this at the automatically determined value.
blocksizeSet or retrieve the size in bytes of the blocks being compressed. It is highly recommended to leave this at a value of 0 such that the blosc library will automatically determine the optimal value.
Inherited methods
new()Create a new "blosc" codec object. The typesize argument is
taken from the data type of the array passed in through the data_type
argument and the shuffle argument is chosen based on the data_type.
zarr_codec_blosc$new(data_type, configuration = NULL)data_typeThe zarr_data_type instance of the Zarr array that this codec is used for.
configurationOptional. A list with the configuration parameters for this codec. If not given, the default compression of "zstd" with level 1 will be used.
An instance of this class.
copy()Create a new, independent copy of this codec.
zarr_codec_blosc$copy()An instance of zarr_codec_blosc.
encode()This method compresses a data object using the "blosc" compression library.
zarr_codec_blosc$encode(data)dataThe raw vector to be compressed.
A raw vector with compressed data.
decode()This method decompresses a data object using the "blosc" compression library.
zarr_codec_blosc$decode(data)dataThe raw vector to be decoded.
A raw vector with the decoded data.