public interface IHDF5SimpleWriter extends IHDF5SimpleReader
IHDF5Writer
, then assign the writer to a IHDF5SimpleWriter
variable and let
the code completion of your IDE help you find the method you are looking for.
Usage:
float[] f = new float[100]; ... IHDF5SimpleWriter writer = HDF5FactoryProvider.get().open(new File("test.h5")); writer.writeFloatArray("/some/path/dataset", f); writer.close();
Modifier and Type | Method and Description |
---|---|
void |
delete(java.lang.String objectPath)
Removes an object from the file.
|
void |
writeBitField(java.lang.String objectPath,
java.util.BitSet data)
Writes out a bit field ((which can be considered the equivalent to a boolean array of rank
1), provided as a Java
BitSet . |
void |
writeBoolean(java.lang.String objectPath,
boolean value)
Writes out a
boolean value. |
void |
writeByteArray(java.lang.String objectPath,
byte[] data)
Writes out a
byte array (of rank 1). |
<T> void |
writeCompound(java.lang.String objectPath,
T data)
Writes out a compound value.
|
<T> void |
writeCompoundArray(java.lang.String objectPath,
T[] data)
Writes out an array (of rank 1) of compound values.
|
void |
writeDate(java.lang.String objectPath,
java.util.Date date)
Writes out a time stamp value provided as a
Date . |
void |
writeDateArray(java.lang.String objectPath,
java.util.Date[] dates)
Writes out a
Date array (of rank 1). |
void |
writeDouble(java.lang.String objectPath,
double value)
Writes out a
double value. |
void |
writeDoubleArray(java.lang.String objectPath,
double[] data)
Writes out a
double array (of rank 1). |
void |
writeDoubleMatrix(java.lang.String objectPath,
double[][] data)
Writes out a
double matrix (array of rank 2). |
<T extends java.lang.Enum<T>> |
writeEnum(java.lang.String objectPath,
java.lang.Enum<T> value)
Writes out an enum value.
|
<T extends java.lang.Enum<T>> |
writeEnumArray(java.lang.String objectPath,
java.lang.Enum<T>[] data)
Writes out an array of enum values.
|
void |
writeEnumArray(java.lang.String objectPath,
java.lang.String[] options,
java.lang.String[] data)
Writes out an array of enum values.
|
void |
writeFloat(java.lang.String objectPath,
float value)
Writes out a
float value. |
void |
writeFloatArray(java.lang.String objectPath,
float[] data)
Writes out a
float array (of rank 1). |
void |
writeFloatMatrix(java.lang.String objectPath,
float[][] data)
Writes out a
float matrix (array of rank 2). |
void |
writeInt(java.lang.String objectPath,
int value)
Writes out a
int value. |
void |
writeIntArray(java.lang.String objectPath,
int[] data)
Writes out a
int array (of rank 1). |
void |
writeIntMatrix(java.lang.String objectPath,
int[][] data)
Writes out a
int matrix (array of rank 2). |
void |
writeLong(java.lang.String objectPath,
long value)
Writes out a
long value. |
void |
writeLongArray(java.lang.String objectPath,
long[] data)
Writes out a
long array (of rank 1). |
void |
writeLongMatrix(java.lang.String objectPath,
long[][] data)
Writes out a
long matrix (array of rank 2). |
void |
writeString(java.lang.String objectPath,
java.lang.String data)
Writes out a
String with a fixed maximal length. |
void |
writeStringArray(java.lang.String objectPath,
java.lang.String[] data)
Writes out a
String array (of rank 1). |
void |
writeTimeDuration(java.lang.String objectPath,
HDF5TimeDuration timeDuration)
Writes out a time duration value.
|
void |
writeTimeDurationArray(java.lang.String objectPath,
HDF5TimeDurationArray timeDurations)
Writes out a time duration array (of rank 1).
|
close, exists, getDataSetInformation, getGroupMembers, isGroup, readAsByteArray, readBitField, readBoolean, readCompound, readCompoundArray, readDate, readDateArray, readDouble, readDoubleArray, readDoubleMatrix, readEnum, readEnumArray, readEnumArrayAsString, readEnumAsString, readFloat, readFloatArray, readFloatMatrix, readInt, readIntArray, readIntMatrix, readLong, readLongArray, readLongMatrix, readString, readStringArray, readTimeDuration, readTimeDurationArray
void delete(java.lang.String objectPath)
void writeBoolean(java.lang.String objectPath, boolean value)
boolean
value.objectPath
- The name (including path information) of the data set object in the file.value
- The value of the data set.void writeBitField(java.lang.String objectPath, java.util.BitSet data)
BitSet
.
Note that the storage form of the bit array is a long[]
. However, it is marked
in HDF5 to be interpreted bit-wise. Thus a data set written by this method cannot be read
back by IHDF5SimpleReader.readLongArray(String)
but will throw a
HDF5DatatypeInterfaceException
.
objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
.void writeByteArray(java.lang.String objectPath, byte[] data)
byte
array (of rank 1). Uses a compact storage layout. Should only
be used for small data sets.objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
.void writeInt(java.lang.String objectPath, int value)
int
value.objectPath
- The name (including path information) of the data set object in the file.value
- The value to write.void writeIntArray(java.lang.String objectPath, int[] data)
int
array (of rank 1).objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
.void writeIntMatrix(java.lang.String objectPath, int[][] data)
int
matrix (array of rank 2).objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
. All columns need to have the
same length.void writeLong(java.lang.String objectPath, long value)
long
value.objectPath
- The name (including path information) of the data set object in the file.value
- The value to write.void writeLongArray(java.lang.String objectPath, long[] data)
long
array (of rank 1).objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
.void writeLongMatrix(java.lang.String objectPath, long[][] data)
long
matrix (array of rank 2).objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
. All columns need to have the
same length.void writeFloat(java.lang.String objectPath, float value)
float
value.objectPath
- The name (including path information) of the data set object in the file.value
- The value to write.void writeFloatArray(java.lang.String objectPath, float[] data)
float
array (of rank 1).objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
.void writeFloatMatrix(java.lang.String objectPath, float[][] data)
float
matrix (array of rank 2).objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
. All columns need to have the
same length.void writeDouble(java.lang.String objectPath, double value)
double
value.objectPath
- The name (including path information) of the data set object in the file.value
- The value to write.void writeDoubleArray(java.lang.String objectPath, double[] data)
double
array (of rank 1).objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
.void writeDoubleMatrix(java.lang.String objectPath, double[][] data)
double
matrix (array of rank 2).objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
. All columns need to have the
same length.void writeDate(java.lang.String objectPath, java.util.Date date)
Date
. The data set will be tagged as type
variant HDF5DataTypeVariant.TIMESTAMP_MILLISECONDS_SINCE_START_OF_THE_EPOCH
.
Note: This is a convenience method for
objectPath
- The name (including path information) of the data set object in the file.date
- The date to write.void writeDateArray(java.lang.String objectPath, java.util.Date[] dates)
Date
array (of rank 1).objectPath
- The name (including path information) of the data set object in the file.dates
- The dates to write.void writeTimeDuration(java.lang.String objectPath, HDF5TimeDuration timeDuration)
Note: Time durations are stored as long[]
arrays and tagged as the according
type variant.
objectPath
- The name (including path information) of the data set object in the file.timeDuration
- The duration of time to write.void writeTimeDurationArray(java.lang.String objectPath, HDF5TimeDurationArray timeDurations)
Note: Time durations are stored as long[]
arrays and tagged as the according
type variant.
objectPath
- The name (including path information) of the data set object in the file.timeDurations
- The time durations to write.void writeString(java.lang.String objectPath, java.lang.String data)
String
with a fixed maximal length.objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
.void writeStringArray(java.lang.String objectPath, java.lang.String[] data)
String
array (of rank 1). Each element of the array will have a
fixed maximal length which is given by the longest element.objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
.<T> void writeCompound(java.lang.String objectPath, T data)
objectPath
- The name (including path information) of the data set object in the file.data
- The value of the data set. May be a pojo (Data Transfer Object), a
HDF5CompoundDataMap
, HDF5CompoundDataList
or Object[]
.CompoundType
,
CompoundElement
<T> void writeCompoundArray(java.lang.String objectPath, T[] data)
objectPath
- The name (including path information) of the data set object in the file.data
- The value of the data set. May be a pojo (Data Transfer Object), a
HDF5CompoundDataMap
, HDF5CompoundDataList
or Object[]
.CompoundType
,
CompoundElement
<T extends java.lang.Enum<T>> void writeEnum(java.lang.String objectPath, java.lang.Enum<T> value) throws HDF5JavaException
objectPath
- The name (including path information) of the data set object in the file.value
- The value of the data set.HDF5JavaException
- If the enum type of value is not a type of this file.<T extends java.lang.Enum<T>> void writeEnumArray(java.lang.String objectPath, java.lang.Enum<T>[] data)
objectPath
- The name (including path information) of the data set object in the file.data
- The data to write.void writeEnumArray(java.lang.String objectPath, java.lang.String[] options, java.lang.String[] data)
objectPath
- The name (including path information) of the data set object in the file.options
- The allowed values of the enumeration type.data
- The data to write.