public class HDFArray extends Object
Constructor and Description |
---|
HDFArray(Object anArray)
The input must be a Java Array (possibly multidimensional) of primitive numbers or sub-classes of
Number.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public HDFArray(Object anArray) throws HDF5JavaException
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.
anArray
- The array object.HDF5JavaException
- object is not an array.public byte[] emptyBytes() throws HDF5JavaException
HDF5JavaException
- Allocation failed.public byte[] byteify() throws HDF5JavaException
HDF5JavaException
- the object not an array or other internal error.public Object arrayify(byte[] bytes) throws HDF5JavaException
bytes
- The bytes to construct the Array.HDF5JavaException
- the object not an array or other internal error.Copyright © 2024. All rights reserved.