|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectncsa.hdf.hdf5lib.HDFArray
public class HDFArray
This is a class for handling multidimensional arrays for HDF.
The purpose is to allow the storage and retrieval of arbitrary array types containing scientific data.
The methods support the conversion of an array to and from Java to a one-dimensional array of bytes suitable for I/O by the C library.
This class heavily uses the HDFNativeData class to convert between Java and C representations.
Constructor Summary | |
---|---|
HDFArray(java.lang.Object anArray)
The input must be a Java Array (possibly multidimensional) of primitive numbers or sub-classes of Number. |
Method Summary | |
---|---|
java.lang.Object |
arrayify(byte[] bytes)
Given a one-dimensional array of bytes representing numbers, convert it to a java array of the shape and size passed to the constructor. |
byte[] |
byteify()
Given a Java array of numbers, convert it to a one-dimensional array of bytes in correct native order. |
byte[] |
emptyBytes()
Allocate a one-dimensional array of bytes sufficient to store the array. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HDFArray(java.lang.Object anArray) throws HDF5Exception
The input is analysed to determine the number of dimensions and size of each dimension, as well as the type of the elements.
The description is saved in private variables, and used to convert data.
HDF5Exception
- object is not an array.Method Detail |
---|
public byte[] emptyBytes() throws HDF5Exception
ncsa.hdf.hdf5lib.exception.HDF5JavaException
- Allocation failed.
HDF5Exception
public byte[] byteify() throws HDF5Exception
ncsa.hdf.hdf5lib.exception.HDF5Exception
- thrown for errors in HDF5
ncsa.hdf.hdf5lib.exception.HDF5JavaException
- the object not an array or other internal error.
HDF5Exception
public java.lang.Object arrayify(byte[] bytes) throws HDF5Exception
bytes
- The bytes to construct the Array.
ncsa.hdf.hdf5lib.exception.HDF5Exception
- thrown for errors in HDF5
ncsa.hdf.hdf5lib.exception.HDF5JavaException
- the object not an array or other internal error.
HDF5Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |