writeChunk

fnvoid writeChunk(hid_t datasetId, uint filters, const hsize_t * offset, size_t dataSize, const void * data, hid_t dxpl = H5P_DEFAULT)

Writes a raw data chunk directly to a chunked dataset.

This function writes a chunk of raw data directly to storage, bypassing the filter pipeline. This is useful when the application handles compression externally and wants to write pre-compressed data.

Parameters

datasetIdDataset identifier (must be chunked)
filtersFilter mask indicating which filters were applied to the data
offsetLogical position of the chunk within the dataset
dataSizeSize of the chunk data in bytes
dataBuffer containing the chunk data to write
dxplDataset transfer property list (default: H5P_DEFAULT)

Throws

HDF5Exception if the write operation fails

Example:

// Write a pre-compressed chunk at position [0, 0]
hsize_t[2] offset = [0, 0];
ubyte[] compressedData = compress(rawData);
writeChunk(dataset.handle(), 0, offset.ptr, compressedData.length, compressedData.ptr);

fnvoid writeChunk(size_t N)(hid_t datasetId, uint filters, const hsize_t[N] offset, size_t dataSize, const void * data, hid_t dxpl = H5P_DEFAULT)

Writes a raw data chunk directly to a chunked dataset (array overload).

Parameters

datasetIdDataset identifier (must be chunked)
filtersFilter mask indicating which filters were applied to the data
offsetLogical position of the chunk within the dataset
dataSizeSize of the chunk data in bytes
dataBuffer containing the chunk data to write
dxplDataset transfer property list (default: H5P_DEFAULT)

Throws

HDF5Exception if the write operation fails
fnvoid writeChunk(T)(hid_t datasetId, uint filters, const hsize_t * offset, const T[] data, hid_t dxpl = H5P_DEFAULT)

Writes a raw data chunk directly to a chunked dataset (slice overload).

This overload accepts a typed array slice and automatically calculates the data size.

Parameters

datasetIdDataset identifier (must be chunked)
filtersFilter mask indicating which filters were applied to the data
offsetLogical position of the chunk within the dataset
dataArray slice containing the chunk data to write
dxplDataset transfer property list (default: H5P_DEFAULT)

Throws

HDF5Exception if the write operation fails