readChunk

fnuint readChunk(hid_t datasetId, const hsize_t * offset, void * buffer, hid_t dxpl = H5P_DEFAULT)

Reads a raw data chunk directly from a chunked dataset.

This function reads a chunk of raw data directly from storage, bypassing the filter pipeline. The data is returned in its stored form (e.g., compressed if compression was applied during write).

Parameters

datasetIdDataset identifier (must be chunked)
offsetLogical position of the chunk within the dataset (array of coordinates)
bufferBuffer to receive the chunk data (must be large enough)
dxplDataset transfer property list (default: H5P_DEFAULT)

Returns

Filter mask indicating which filters were applied to the stored data

Throws

HDF5Exception if the read operation fails

Example:

// Read the chunk at position [0, 0] from a 2D chunked dataset
hsize_t[2] offset = [0, 0];
ubyte[] buffer = new ubyte[chunkSize];
auto filters = readChunk(dataset.handle(), offset.ptr, buffer.ptr);

fnuint readChunk(size_t N)(hid_t datasetId, const hsize_t[N] offset, void * buffer, hid_t dxpl = H5P_DEFAULT)

Reads a raw data chunk directly from a chunked dataset (array overload).

Parameters

datasetIdDataset identifier (must be chunked)
offsetLogical position of the chunk within the dataset
bufferBuffer to receive the chunk data (must be large enough)
dxplDataset transfer property list (default: H5P_DEFAULT)

Returns

Filter mask indicating which filters were applied to the stored data

Throws

HDF5Exception if the read operation fails