public interface IHDF5FloatWriter extends IHDF5FloatReader
float
values to HDF5 files.
Note: This interface supports block access and sliced access (which is a special cases of block access) to arrays. The performance of this block access can vary greatly depending on how the data are layed out in the HDF5 file. For best performance, the block (or slice) dimension should be chosen to be equal to the chunk dimensions of the array, as in this case the block written / read are stored as consecutive value in the HDF5 file and one write / read access will suffice.
Modifier and Type | Method and Description |
---|---|
void |
createArray(java.lang.String objectPath,
int size)
Creates a
float array (of rank 1). |
void |
createArray(java.lang.String objectPath,
int size,
HDF5FloatStorageFeatures features)
Creates a
float array (of rank 1). |
void |
createArray(java.lang.String objectPath,
long size,
int blockSize)
Creates a
float array (of rank 1). |
void |
createArray(java.lang.String objectPath,
long size,
int blockSize,
HDF5FloatStorageFeatures features)
Creates a
float array (of rank 1). |
void |
createMatrix(java.lang.String objectPath,
int sizeX,
int sizeY)
Creates a
float matrix (array of rank 2). |
void |
createMatrix(java.lang.String objectPath,
int sizeX,
int sizeY,
HDF5FloatStorageFeatures features)
Creates a
float matrix (array of rank 2). |
void |
createMatrix(java.lang.String objectPath,
long sizeX,
long sizeY,
int blockSizeX,
int blockSizeY)
Creates a
float matrix (array of rank 2). |
void |
createMatrix(java.lang.String objectPath,
long sizeX,
long sizeY,
int blockSizeX,
int blockSizeY,
HDF5FloatStorageFeatures features)
Creates a
float matrix (array of rank 2). |
void |
createMDArray(java.lang.String objectPath,
int[] dimensions)
Creates a multi-dimensional
float array. |
void |
createMDArray(java.lang.String objectPath,
int[] dimensions,
HDF5FloatStorageFeatures features)
Creates a multi-dimensional
float array. |
void |
createMDArray(java.lang.String objectPath,
long[] dimensions,
int[] blockDimensions)
Creates a multi-dimensional
float array. |
void |
createMDArray(java.lang.String objectPath,
long[] dimensions,
int[] blockDimensions,
HDF5FloatStorageFeatures features)
Creates a multi-dimensional
float array. |
void |
setArrayAttr(java.lang.String objectPath,
java.lang.String name,
float[] value)
Set a
float[] attribute on the referenced object. |
void |
setAttr(java.lang.String objectPath,
java.lang.String name,
float value)
Set a
float attribute on the referenced object. |
void |
setMatrixAttr(java.lang.String objectPath,
java.lang.String name,
float[][] value)
Set a
float[][] attribute on the referenced object. |
void |
setMDArrayAttr(java.lang.String objectPath,
java.lang.String name,
MDFloatArray value)
Set a multi-dimensional code>float attribute on the referenced object.
|
void |
write(java.lang.String objectPath,
float value)
Writes out a
float value. |
void |
writeArray(java.lang.String objectPath,
float[] data)
Writes out a
float array (of rank 1). |
void |
writeArray(java.lang.String objectPath,
float[] data,
HDF5FloatStorageFeatures features)
Writes out a
float array (of rank 1). |
void |
writeArrayBlock(java.lang.String objectPath,
float[] data,
long blockNumber)
Writes out a block of a
float array (of rank 1). |
void |
writeArrayBlockWithOffset(java.lang.String objectPath,
float[] data,
int dataSize,
long offset)
Writes out a block of a
float array (of rank 1). |
void |
writeMatrix(java.lang.String objectPath,
float[][] data)
Writes out a
float matrix (array of rank 2). |
void |
writeMatrix(java.lang.String objectPath,
float[][] data,
HDF5FloatStorageFeatures features)
Writes out a
float matrix (array of rank 2). |
void |
writeMatrixBlock(java.lang.String objectPath,
float[][] data,
long blockNumberX,
long blockNumberY)
Writes out a block of a
float matrix (array of rank 2). |
void |
writeMatrixBlockWithOffset(java.lang.String objectPath,
float[][] data,
int dataSizeX,
int dataSizeY,
long offsetX,
long offsetY)
Writes out a block of a
float matrix (array of rank 2). |
void |
writeMatrixBlockWithOffset(java.lang.String objectPath,
float[][] data,
long offsetX,
long offsetY)
Writes out a block of a
float matrix (array of rank 2). |
void |
writeMDArray(java.lang.String objectPath,
MDFloatArray data)
Writes out a multi-dimensional
float array. |
void |
writeMDArray(java.lang.String objectPath,
MDFloatArray data,
HDF5FloatStorageFeatures features)
Writes out a multi-dimensional
float array. |
void |
writeMDArrayBlock(java.lang.String objectPath,
MDFloatArray data,
long[] blockNumber)
Writes out a block of a multi-dimensional
float array. |
void |
writeMDArrayBlockWithOffset(java.lang.String objectPath,
MDFloatArray data,
int[] blockDimensions,
long[] offset,
int[] memoryOffset)
Writes out a block of a multi-dimensional
float array. |
void |
writeMDArrayBlockWithOffset(java.lang.String objectPath,
MDFloatArray data,
long[] offset)
Writes out a block of a multi-dimensional
float array. |
void |
writeMDArraySlice(java.lang.String objectPath,
MDFloatArray data,
IndexMap boundIndices)
Writes out a slice of a multi-dimensional
float array. |
void |
writeMDArraySlice(java.lang.String objectPath,
MDFloatArray data,
long[] boundIndices)
Writes out a slice of a multi-dimensional
float array. |
void |
writeSlicedMDArrayBlock(java.lang.String objectPath,
MDFloatArray data,
long[] blockNumber,
IndexMap boundIndices)
Writes out a sliced block of a multi-dimensional
float array. |
void |
writeSlicedMDArrayBlock(java.lang.String objectPath,
MDFloatArray data,
long[] blockNumber,
long[] boundIndices)
Writes out a sliced block of a multi-dimensional
float array. |
void |
writeSlicedMDArrayBlockWithOffset(java.lang.String objectPath,
MDFloatArray data,
long[] offset,
IndexMap boundIndices)
Writes out a sliced block of a multi-dimensional
float array. |
void |
writeSlicedMDArrayBlockWithOffset(java.lang.String objectPath,
MDFloatArray data,
long[] offset,
long[] boundIndices)
Writes out a sliced block of a multi-dimensional
float array. |
getArrayAttr, getArrayNaturalBlocks, getAttr, getMatrixAttr, getMDArrayAttr, getMDArrayNaturalBlocks, read, readArray, readArrayBlock, readArrayBlockWithOffset, readMatrix, readMatrixBlock, readMatrixBlockWithOffset, readMDArray, readMDArrayBlock, readMDArrayBlockWithOffset, readMDArraySlice, readMDArraySlice, readSlicedMDArrayBlock, readSlicedMDArrayBlock, readSlicedMDArrayBlockWithOffset, readSlicedMDArrayBlockWithOffset, readToMDArrayBlockWithOffset, readToMDArrayWithOffset
void setAttr(java.lang.String objectPath, java.lang.String name, float value)
float
attribute on the referenced object.
The referenced object must exist, that is it need to have been written before by one of the
write()
methods.
objectPath
- The name of the object to add the attribute to.name
- The name of the attribute.value
- The value of the attribute.void setArrayAttr(java.lang.String objectPath, java.lang.String name, float[] value)
float[]
attribute on the referenced object.
The referenced object must exist, that is it need to have been written before by one of the
write()
methods.
objectPath
- The name of the object to add the attribute to.name
- The name of the attribute.value
- The value of the attribute.void setMDArrayAttr(java.lang.String objectPath, java.lang.String name, MDFloatArray value)
The referenced object must exist, that is it need to have been written before by one of the
write()
methods.
objectPath
- The name of the object to add the attribute to.name
- The name of the attribute.value
- The value of the attribute.void setMatrixAttr(java.lang.String objectPath, java.lang.String name, float[][] value)
float[][]
attribute on the referenced object.
The referenced object must exist, that is it need to have been written before by one of the
write()
methods.
objectPath
- The name of the object to add the attribute to.name
- The name of the attribute.value
- The value of the attribute.void write(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 writeArray(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 writeArray(java.lang.String objectPath, float[] data, HDF5FloatStorageFeatures features)
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
.features
- The storage features of the data set.void createArray(java.lang.String objectPath, int size)
float
array (of rank 1).objectPath
- The name (including path information) of the data set object in the file.size
- When the writer is configured to use extendable data types (see
IHDF5WriterConfigurator.dontUseExtendableDataTypes()
), the initial size
and the chunk size of the array will be size. When the writer is
configured to enforce a non-extendable data set, the initial size equals the
total size and will be size.void createArray(java.lang.String objectPath, long size, int blockSize)
float
array (of rank 1).objectPath
- The name (including path information) of the data set object in the file.size
- The size of the float array to create. When using extendable data sets
((see IHDF5WriterConfigurator.dontUseExtendableDataTypes()
)), then no data
set smaller than this size can be created, however data sets may be larger.blockSize
- The size of one block (for block-wise IO). Ignored if no extendable data
sets are used (see IHDF5WriterConfigurator.dontUseExtendableDataTypes()
).void createArray(java.lang.String objectPath, int size, HDF5FloatStorageFeatures features)
float
array (of rank 1).objectPath
- The name (including path information) of the data set object in the file.size
- The size of the float
array to create. When requesting a
chunked data set (e.g. HDF5FloatStorageFeatures.FLOAT_CHUNKED
),
the initial size of the array will be 0 and the chunk size will be arraySize.
When allowing a chunked data set (e.g.
HDF5FloatStorageFeatures.FLOAT_NO_COMPRESSION
when the writer is
not configured to avoid extendable data types, see
IHDF5WriterConfigurator.dontUseExtendableDataTypes()
), the initial size
and the chunk size of the array will be arraySize. When enforcing a
on-extendable data set (e.g.
HDF5FloatStorageFeatures.FLOAT_CONTIGUOUS
), the initial size equals
the total size and will be arraySize.features
- The storage features of the data set.void createArray(java.lang.String objectPath, long size, int blockSize, HDF5FloatStorageFeatures features)
float
array (of rank 1).objectPath
- The name (including path information) of the data set object in the file.size
- The size of the float array to create. When using extendable data sets
((see IHDF5WriterConfigurator.dontUseExtendableDataTypes()
)), then no data
set smaller than this size can be created, however data sets may be larger.blockSize
- The size of one block (for block-wise IO). Ignored if no extendable data
sets are used (see IHDF5WriterConfigurator.dontUseExtendableDataTypes()
) and
features
is HDF5FloatStorageFeature.FLOAT_NO_COMPRESSION
.features
- The storage features of the data set.void writeArrayBlock(java.lang.String objectPath, float[] data, long blockNumber)
float
array (of rank 1). The data set needs to have
been created by createArray(String, long, int, HDF5FloatStorageFeatures)
beforehand.objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. The length defines the block size. Must not be
null
or of length 0.blockNumber
- The number of the block to write.void writeArrayBlockWithOffset(java.lang.String objectPath, float[] data, int dataSize, long offset)
float
array (of rank 1). The data set needs to have
been created by createArray(String, long, int, HDF5FloatStorageFeatures)
beforehand.
Use this method instead of writeArrayBlock(String, float[], long)
if the
total size of the data set is not a multiple of the block size.
objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. The length defines the block size. Must not be
null
or of length 0.dataSize
- The (real) size of data
(needs to be <= data.length
)offset
- The offset in the data set to start writing to.void writeMatrix(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 writeMatrix(java.lang.String objectPath, float[][] data, HDF5FloatStorageFeatures features)
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.features
- The storage features of the data set.void createMatrix(java.lang.String objectPath, int sizeX, int sizeY)
float
matrix (array of rank 2).objectPath
- The name (including path information) of the data set object in the file.sizeX
- The size of one block in the x dimension. See
createMDArray(String, int[])
on the different
meanings of this parameter.sizeY
- The size of one block in the y dimension. See
createMDArray(String, int[])
on the different
meanings of this parameter.void createMatrix(java.lang.String objectPath, int sizeX, int sizeY, HDF5FloatStorageFeatures features)
float
matrix (array of rank 2).objectPath
- The name (including path information) of the data set object in the file.sizeX
- The size of one block in the x dimension. See
createMDArray(String, int[], HDF5FloatStorageFeatures)
on the different
meanings of this parameter.sizeY
- The size of one block in the y dimension. See
createMDArray(String, int[], HDF5FloatStorageFeatures)
on the different
meanings of this parameter.features
- The storage features of the data set.void createMatrix(java.lang.String objectPath, long sizeX, long sizeY, int blockSizeX, int blockSizeY)
float
matrix (array of rank 2).objectPath
- The name (including path information) of the data set object in the file.sizeX
- The size of the x dimension of the float matrix to create.sizeY
- The size of the y dimension of the float matrix to create.blockSizeX
- The size of one block in the x dimension.blockSizeY
- The size of one block in the y dimension.void createMatrix(java.lang.String objectPath, long sizeX, long sizeY, int blockSizeX, int blockSizeY, HDF5FloatStorageFeatures features)
float
matrix (array of rank 2).objectPath
- The name (including path information) of the data set object in the file.sizeX
- The size of the x dimension of the float matrix to create.sizeY
- The size of the y dimension of the float matrix to create.blockSizeX
- The size of one block in the x dimension.blockSizeY
- The size of one block in the y dimension.features
- The storage features of the data set.void writeMatrixBlock(java.lang.String objectPath, float[][] data, long blockNumberX, long blockNumberY)
float
matrix (array of rank 2). The data set needs to
have been created by
createMatrix(String, long, long, int, int, HDF5FloatStorageFeatures)
beforehand.
Use this method instead of
createMatrix(String, long, long, int, int, HDF5FloatStorageFeatures)
if the total
size of the data set is not a multiple of the block size.
objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. The length defines the block size. Must not be
null
or of length 0.blockNumberX
- The block number in the x dimension (offset: multiply with
data.length
).blockNumberY
- The block number in the y dimension (offset: multiply with
data[0.length
).void writeMatrixBlockWithOffset(java.lang.String objectPath, float[][] data, long offsetX, long offsetY)
float
matrix (array of rank 2). The data set needs to
have been created by
createMatrix(String, long, long, int, int, HDF5FloatStorageFeatures)
beforehand.
Use this method instead of writeMatrixBlock(String, float[][], long, long)
if
the total size of the data set is not a multiple of the block size.
objectPath
- The name (including path information) of the data set object in the file.data
- The data to write.offsetX
- The x offset in the data set to start writing to.offsetY
- The y offset in the data set to start writing to.void writeMatrixBlockWithOffset(java.lang.String objectPath, float[][] data, int dataSizeX, int dataSizeY, long offsetX, long offsetY)
float
matrix (array of rank 2). The data set needs to
have been created by
createMatrix(String, long, long, int, int, HDF5FloatStorageFeatures)
beforehand.
Use this method instead of writeMatrixBlock(String, float[][], long, long)
if
the total size of the data set is not a multiple of the block size.
objectPath
- The name (including path information) of the data set object in the file.data
- The data to write.dataSizeX
- The (real) size of data
along the x axis (needs to be
<= data.length
)dataSizeY
- The (real) size of data
along the y axis (needs to be
<= data[0].length
)offsetX
- The x offset in the data set to start writing to.offsetY
- The y offset in the data set to start writing to.void writeMDArray(java.lang.String objectPath, MDFloatArray data)
float
array.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 writeMDArray(java.lang.String objectPath, MDFloatArray data, HDF5FloatStorageFeatures features)
float
array.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.features
- The storage features of the data set.void writeMDArraySlice(java.lang.String objectPath, MDFloatArray data, IndexMap boundIndices)
float
array. The slice is defined by
"bound indices", each of which is fixed to a given value. The data object only
contains the free (i.e. non-fixed) indices.
Note:The object identified by objectPath needs to exist when this method is called. This method will not create the array.
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.boundIndices
- The mapping of indices to index values which should be bound. For example
a map of new IndexMap().mapTo(2, 5).mapTo(4, 7)
has 2 and 4 as bound
indices and binds them to the values 5 and 7, respectively.void writeMDArraySlice(java.lang.String objectPath, MDFloatArray data, long[] boundIndices)
float
array. The slice is defined by
"bound indices", each of which is fixed to a given value. The data object only
contains the free (i.e. non-fixed) indices.
Note:The object identified by objectPath needs to exist when this method is called. This method will not create the array.
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.boundIndices
- The array containing the values of the bound indices at the respective
index positions, and -1 at the free index positions. For example an array of
new long[] { -1, -1, 5, -1, 7, -1 }
has 2 and 4 as bound indices and
binds them to the values 5 and 7, respectively.void createMDArray(java.lang.String objectPath, int[] dimensions)
float
array.objectPath
- The name (including path information) of the data set object in the file.dimensions
- When the writer is configured to use extendable data types (see
IHDF5WriterConfigurator.dontUseExtendableDataTypes()
), the initial dimensions
and the dimensions of a chunk of the array will be dimensions. When the
writer is configured to enforce a non-extendable data set, the initial dimensions
equal the dimensions and will be dimensions.void createMDArray(java.lang.String objectPath, long[] dimensions, int[] blockDimensions)
float
array.objectPath
- The name (including path information) of the data set object in the file.dimensions
- The dimensions of the array.blockDimensions
- The dimensions of one block (chunk) of the array.void createMDArray(java.lang.String objectPath, int[] dimensions, HDF5FloatStorageFeatures features)
float
array.objectPath
- The name (including path information) of the data set object in the file.dimensions
- The dimensions of the float
array to create. When requesting
a chunked data set (e.g. HDF5FloatStorageFeatures.FLOAT_CHUNKED
),
the initial size of the array will be 0 and the chunk size will be dimensions.
When allowing a chunked data set (e.g.
HDF5FloatStorageFeatures.FLOAT_NO_COMPRESSION
when the writer is
not configured to avoid extendable data types, see
IHDF5WriterConfigurator.dontUseExtendableDataTypes()
), the initial size
and the chunk size of the array will be dimensions. When enforcing a
on-extendable data set (e.g.
HDF5FloatStorageFeatures.FLOAT_CONTIGUOUS
), the initial size equals
the total size and will be dimensions.features
- The storage features of the data set.void createMDArray(java.lang.String objectPath, long[] dimensions, int[] blockDimensions, HDF5FloatStorageFeatures features)
float
array.objectPath
- The name (including path information) of the data set object in the file.dimensions
- The dimensions of the array.blockDimensions
- The dimensions of one block (chunk) of the array.features
- The storage features of the data set.void writeMDArrayBlock(java.lang.String objectPath, MDFloatArray data, long[] blockNumber)
float
array.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.blockNumber
- The block number in each dimension (offset: multiply with the extend in
the according dimension).void writeSlicedMDArrayBlock(java.lang.String objectPath, MDFloatArray data, long[] blockNumber, IndexMap boundIndices)
float
array. The slice is
defined by "bound indices", each of which is fixed to a given value. The data
object only contains the free (i.e. non-fixed) indices.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.blockNumber
- The block number in each dimension (offset: multiply with the extend in
the according dimension).boundIndices
- The array containing the values of the bound indices at the respective
index positions, and -1 at the free index positions. For example an array of
new long[] { -1, -1, 5, -1, 7, -1 }
has 2 and 4 as bound indices and
binds them to the values 5 and 7, respectively.void writeSlicedMDArrayBlock(java.lang.String objectPath, MDFloatArray data, long[] blockNumber, long[] boundIndices)
float
array. The slice is
defined by "bound indices", each of which is fixed to a given value. The data
object only contains the free (i.e. non-fixed) indices.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.blockNumber
- The block number in each dimension (offset: multiply with the extend in
the according dimension).boundIndices
- The mapping of indices to index values which should be bound. For example
a map of new IndexMap().mapTo(2, 5).mapTo(4, 7)
has 2 and 4 as bound
indices and binds them to the values 5 and 7, respectively.void writeMDArrayBlockWithOffset(java.lang.String objectPath, MDFloatArray data, long[] offset)
float
array.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.offset
- The offset in the data set to start writing to in each dimension.void writeSlicedMDArrayBlockWithOffset(java.lang.String objectPath, MDFloatArray data, long[] offset, IndexMap boundIndices)
float
array. The slice is
defined by "bound indices", each of which is fixed to a given value. The data
object only contains the free (i.e. non-fixed) indices.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.offset
- The offset in the data set to start writing to in each dimension.boundIndices
- The array containing the values of the bound indices at the respective
index positions, and -1 at the free index positions. For example an array of
new long[] { -1, -1, 5, -1, 7, -1 }
has 2 and 4 as bound indices and
binds them to the values 5 and 7, respectively.void writeSlicedMDArrayBlockWithOffset(java.lang.String objectPath, MDFloatArray data, long[] offset, long[] boundIndices)
float
array. The slice is
defined by "bound indices", each of which is fixed to a given value. The data
object only contains the free (i.e. non-fixed) indices.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.offset
- The offset in the data set to start writing to in each dimension.boundIndices
- The array containing the values of the bound indices at the respective
index positions, and -1 at the free index positions. For example an array of
new long[] { -1, -1, 5, -1, 7, -1 }
has 2 and 4 as bound indices and
binds them to the values 5 and 7, respectively.void writeMDArrayBlockWithOffset(java.lang.String objectPath, MDFloatArray data, int[] blockDimensions, long[] offset, int[] memoryOffset)
float
array.objectPath
- The name (including path information) of the data set object in the file.data
- The data to write. Must not be null
.blockDimensions
- The dimensions of the block to write to the data set.offset
- The offset of the block in the data set to start writing to in each dimension.memoryOffset
- The offset of the block in the data array.