Source
H5.H5Dwrite(dataset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/************************************************************
This example shows how to set the fill value for a
dataset. The program first sets the fill value to
FILLVAL, creates a dataset with dimensions of DIM_XxDIM_Y,
reads from the uninitialized dataset, and outputs the
contents to the screen. Next, it writes integers to the
dataset, reads the data back, and outputs it to the
screen. Finally it extends the dataset, reads from it,
and outputs the result to the screen.
************************************************************/
package examples.datasets;
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
public class H5Ex_D_FillValue {
private static String FILENAME = "H5Ex_D_FillValue.h5";
private static String DATASETNAME = "ExtendibleArray";
private static final int DIM_X = 4;
private static final int DIM_Y = 7;
private static final int EDIM_X = 6;
private static final int EDIM_Y = 10;
private static final int CHUNK_X = 4;
private static final int CHUNK_Y = 4;
private static final int RANK = 2;
private static final int NDIMS = 2;
private static final int FILLVAL = 99;
private static void fillValue() {
long file_id = -1;
long dcpl_id = -1;
long dataspace_id = -1;
long dataset_id = -1;
long[] dims = { DIM_X, DIM_Y };
long[] extdims = { EDIM_X, EDIM_Y };
long[] chunk_dims = { CHUNK_X, CHUNK_Y };
long[] maxdims = { HDF5Constants.H5S_UNLIMITED, HDF5Constants.H5S_UNLIMITED };
int[][] write_dset_data = new int[DIM_X][DIM_Y];