ncsa.hdf.hdflib
Class HDFArray

java.lang.Object
  extended by ncsa.hdf.hdflib.HDFArray

public class HDFArray
extends java.lang.Object

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)
           
 
Method Summary
 java.lang.Object arrayify(byte[] bytes)
          Given a one-dimensional array of 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

HDFArray

public HDFArray(java.lang.Object anArray)
         throws HDFException
Throws:
HDFException
Method Detail

emptyBytes

public byte[] emptyBytes()
                  throws HDFException
allocate a one-dimensional array of bytes sufficient to store the array.

Throws:
HDFException - .

byteify

public byte[] byteify()
               throws HDFException
Given a Java array of numbers, convert it to a one-dimensional array of bytes in correct native order.

Throws:
HDFException - thrown for errors: object is not array: HDFJavaException

arrayify

public java.lang.Object arrayify(byte[] bytes)
                          throws HDFException
Given a one-dimensional array of numbers, convert it to a java array of the shape and size passed to the constructor.

Throws:
HDFException - thrown for errors: object not an array: HDFJavaException