The Zarr "bytes" codec encodes an R data object to a raw byte string, and decodes a raw byte string to a R object, possibly inverting the endianness of the data in the operation.
zarr::zarr_extension -> zarr::zarr_codec -> zarr_codec_bytes
endianSet or retrieve the endianness of the storage of the data with this codec. A string with value of "big" or "little".
Inherited methods
new()Create a new "bytes" codec object.
zarr_codec_bytes$new(data_type, chunk_shape, configuration = NULL)data_typeThe zarr_data_type instance of the Zarr array that this codec is used for.
chunk_shapeThe shape of a chunk of data of the array, an integer vector.
configurationOptional. A list with the configuration parameters
for this codec. The element endian specifies the byte ordering of the
data type of the Zarr array. A string with value "big" or "little". If
not given, the default endianness of the platform is used.
An instance of this class.
copy()Create a new, independent copy of this codec.
zarr_codec_bytes$copy()An instance of zarr_codec_bytes.
metadata_fragment()Return the metadata fragment that describes this codec.
zarr_codec_bytes$metadata_fragment()A list with the metadata of this codec.
encode()This method writes an R object to a raw vector in the data
type of the Zarr array. Prior to writing, any NA values are assigned
the fill_value of the data_type of the Zarr array. Note that the
logical type cannot encode NA in Zarr and any NA values are set to
FALSE.
zarr_codec_bytes$encode(data)dataThe data to be encoded.
A raw vector with the encoded data object.
decode()This method takes a raw vector and converts it to an R
object of an appropriate type. For all types other than logical, any
data elements with the fill_value of the Zarr data type are set to
NA.
zarr_codec_bytes$decode(data)dataThe data to be decoded.
An R object with the shape of a chunk from the array.