readChunk
fn
uint 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
datasetId | Dataset identifier (must be chunked) |
offset | Logical position of the chunk within the dataset (array of coordinates) |
buffer | Buffer to receive the chunk data (must be large enough) |
dxpl | Dataset 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);fn
uint 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
datasetId | Dataset identifier (must be chunked) |
offset | Logical position of the chunk within the dataset |
buffer | Buffer to receive the chunk data (must be large enough) |
dxpl | Dataset 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