Package hdf.hdf5lib
Class HDFNativeData
- java.lang.Object
-
- hdf.hdf5lib.HDFNativeData
-
public class HDFNativeData extends Object
-
-
Constructor Summary
Constructors Constructor Description HDFNativeData()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]byteToByte(byte data)Convert a single byte into an array of one byte.static byte[]byteToByte(Byte data)Convert a single Byte object into an array of one byte.static double[]byteToDouble(byte[] data)Convert an array of bytes into an array of doublestatic doublebyteToDouble(byte[] data, int start)Convert 8 bytes from an array of bytes into a single doublestatic double[]byteToDouble(int start, int len, byte[] data)Convert a range from an array of bytes into an array of doublestatic float[]byteToFloat(byte[] data)Convert an array of bytes into an array of floatsstatic floatbyteToFloat(byte[] data, int start)Convert 4 bytes from an array of bytes into a single floatstatic float[]byteToFloat(int start, int len, byte[] data)Convert a range from an array of bytes into an array of floatstatic int[]byteToInt(byte[] data)Convert an array of bytes into an array of intsstatic intbyteToInt(byte[] data, int start)Convert 4 bytes from an array of bytes into a single intstatic int[]byteToInt(int start, int len, byte[] data)Convert a range from an array of bytes into an array of intstatic long[]byteToLong(byte[] data)Convert an array of bytes into an array of longstatic longbyteToLong(byte[] data, int start)Convert 8 bytes from an array of bytes into a single longstatic long[]byteToLong(int start, int len, byte[] data)Convert a range from an array of bytes into an array of longstatic ObjectbyteToNumber(byte[] barray, Object obj)Create a Number object from an array of bytes.static short[]byteToShort(byte[] data)Convert an array of bytes into an array of shortsstatic shortbyteToShort(byte[] data, int start)Convert 2 bytes from an array of bytes into a single shortstatic short[]byteToShort(int start, int len, byte[] data)Convert a range from an array of bytes into an array of shortstatic byte[]doubleToByte(double data)Convert a single double into an array of 8 bytes.static byte[]doubleToByte(int start, int len, double[] data)Convert a range from an array of double into an array of bytes.static byte[]doubleToByte(Double data)Convert a single Double object into an array of 8 bytes.static byte[]floatToByte(float data)Convert a single float into an array of 4 bytes.static byte[]floatToByte(int start, int len, float[] data)Convert a range from an array of float into an array of bytes.static byte[]floatToByte(Float data)Convert a single Float object into an array of 4 bytes.static byte[]intToByte(int data)Convert a single int into an array of 4 bytes.static byte[]intToByte(int start, int len, int[] data)Convert a range from an array of int into an array of bytes.static byte[]intToByte(Integer data)Convert a single Integer object into an array of 4 bytes.static byte[]longToByte(int start, int len, long[] data)Convert a range from an array of long into an array of bytes.static byte[]longToByte(long data)Convert a single long into an array of 8 bytes.static byte[]longToByte(Long data)Convert a single Long object into an array of 8 bytes.static byte[]shortToByte(int start, int len, short[] data)Convert a range from an array of short into an array of bytes.static byte[]shortToByte(short data)Convert a single short into an array of 2 bytes.static byte[]shortToByte(Short data)Convert a single Short object into an array of 2 bytes.
-
-
-
Method Detail
-
byteToInt
public static int[] byteToInt(byte[] data)
Convert an array of bytes into an array of ints- Parameters:
data- The input array of bytes- Returns:
- an array of int
-
byteToFloat
public static float[] byteToFloat(byte[] data)
Convert an array of bytes into an array of floats- Parameters:
data- The input array of bytes- Returns:
- an array of float
-
byteToShort
public static short[] byteToShort(byte[] data)
Convert an array of bytes into an array of shorts- Parameters:
data- The input array of bytes- Returns:
- an array of short
-
byteToLong
public static long[] byteToLong(byte[] data)
Convert an array of bytes into an array of long- Parameters:
data- The input array of bytes- Returns:
- an array of long
-
byteToDouble
public static double[] byteToDouble(byte[] data)
Convert an array of bytes into an array of double- Parameters:
data- The input array of bytes- Returns:
- an array of double
-
byteToInt
public static int[] byteToInt(int start, int len, byte[] data)Convert a range from an array of bytes into an array of int- Parameters:
start- The position in the input array of bytes to startlen- The number of 'int' to convertdata- The input array of bytes- Returns:
- an array of 'len' int
-
byteToInt
public static int byteToInt(byte[] data, int start)Convert 4 bytes from an array of bytes into a single int- Parameters:
start- The position in the input array of bytes to startdata- The input array of bytes- Returns:
- The integer value of the bytes.
-
byteToShort
public static short[] byteToShort(int start, int len, byte[] data)Convert a range from an array of bytes into an array of short- Parameters:
start- The position in the input array of bytes to startlen- The number of 'short' to convertdata- The input array of bytes- Returns:
- an array of 'len' short
-
byteToShort
public static short byteToShort(byte[] data, int start)Convert 2 bytes from an array of bytes into a single short- Parameters:
start- The position in the input array of bytes to startdata- The input array of bytes- Returns:
- The short value of the bytes.
-
byteToFloat
public static float[] byteToFloat(int start, int len, byte[] data)Convert a range from an array of bytes into an array of float- Parameters:
start- The position in the input array of bytes to startlen- The number of 'float' to convertdata- The input array of bytes- Returns:
- an array of 'len' float
-
byteToFloat
public static float byteToFloat(byte[] data, int start)Convert 4 bytes from an array of bytes into a single float- Parameters:
start- The position in the input array of bytes to startdata- The input array of bytes- Returns:
- The float value of the bytes.
-
byteToLong
public static long[] byteToLong(int start, int len, byte[] data)Convert a range from an array of bytes into an array of long- Parameters:
start- The position in the input array of bytes to startlen- The number of 'long' to convertdata- The input array of bytes- Returns:
- an array of 'len' long
-
byteToLong
public static long byteToLong(byte[] data, int start)Convert 8 bytes from an array of bytes into a single long- Parameters:
start- The position in the input array of bytes to startdata- The input array of bytes- Returns:
- The long value of the bytes.
-
byteToDouble
public static double[] byteToDouble(int start, int len, byte[] data)Convert a range from an array of bytes into an array of double- Parameters:
start- The position in the input array of bytes to startlen- The number of 'double' to convertdata- The input array of bytes- Returns:
- an array of 'len' double
-
byteToDouble
public static double byteToDouble(byte[] data, int start)Convert 8 bytes from an array of bytes into a single double- Parameters:
start- The position in the input array of bytes to startdata- The input array of bytes- Returns:
- The double value of the bytes.
-
intToByte
public static byte[] intToByte(int start, int len, int[] data)Convert a range from an array of int into an array of bytes.- Parameters:
start- The position in the input array of int to startlen- The number of 'int' to convertdata- The input array of int- Returns:
- an array of bytes
-
shortToByte
public static byte[] shortToByte(int start, int len, short[] data)Convert a range from an array of short into an array of bytes.- Parameters:
start- The position in the input array of int to startlen- The number of 'short' to convertdata- The input array of short- Returns:
- an array of bytes
-
floatToByte
public static byte[] floatToByte(int start, int len, float[] data)Convert a range from an array of float into an array of bytes.- Parameters:
start- The position in the input array of int to startlen- The number of 'float' to convertdata- The input array of float- Returns:
- an array of bytes
-
longToByte
public static byte[] longToByte(int start, int len, long[] data)Convert a range from an array of long into an array of bytes.- Parameters:
start- The position in the input array of int to startlen- The number of 'long' to convertdata- The input array of long- Returns:
- an array of bytes
-
doubleToByte
public static byte[] doubleToByte(int start, int len, double[] data)Convert a range from an array of double into an array of bytes.- Parameters:
start- The position in the input array of double to startlen- The number of 'double' to convertdata- The input array of double- Returns:
- an array of bytes
-
byteToByte
public static byte[] byteToByte(byte data)
Convert a single byte into an array of one byte.(This is a trivial method.)
- Parameters:
data- The input byte- Returns:
- an array of bytes
-
byteToByte
public static byte[] byteToByte(Byte data)
Convert a single Byte object into an array of one byte.(This is an almost trivial method.)
- Parameters:
data- The input Byte- Returns:
- an array of bytes
-
intToByte
public static byte[] intToByte(int data)
Convert a single int into an array of 4 bytes.- Parameters:
data- The input int- Returns:
- an array of bytes
-
intToByte
public static byte[] intToByte(Integer data)
Convert a single Integer object into an array of 4 bytes.- Parameters:
data- The input Integer- Returns:
- an array of bytes
-
shortToByte
public static byte[] shortToByte(short data)
Convert a single short into an array of 2 bytes.- Parameters:
data- The input short- Returns:
- an array of bytes
-
shortToByte
public static byte[] shortToByte(Short data)
Convert a single Short object into an array of 2 bytes.- Parameters:
data- The input Short- Returns:
- an array of bytes
-
floatToByte
public static byte[] floatToByte(float data)
Convert a single float into an array of 4 bytes.- Parameters:
data- The input float- Returns:
- an array of bytes
-
floatToByte
public static byte[] floatToByte(Float data)
Convert a single Float object into an array of 4 bytes.- Parameters:
data- The input Float- Returns:
- an array of bytes
-
longToByte
public static byte[] longToByte(long data)
Convert a single long into an array of 8 bytes.- Parameters:
data- The input long- Returns:
- an array of bytes
-
longToByte
public static byte[] longToByte(Long data)
Convert a single Long object into an array of 8 bytes.- Parameters:
data- The input Long- Returns:
- an array of bytes
-
doubleToByte
public static byte[] doubleToByte(double data)
Convert a single double into an array of 8 bytes.- Parameters:
data- The input double- Returns:
- an array of bytes
-
doubleToByte
public static byte[] doubleToByte(Double data)
Convert a single Double object into an array of 8 bytes.- Parameters:
data- The input Double- Returns:
- an array of bytes
-
byteToNumber
public static Object byteToNumber(byte[] barray, Object obj) throws HDF5Exception
Create a Number object from an array of bytes.- Parameters:
barray- The bytes to be convertedobj- Input object of the desired output class. Must be a sub-class of Number.- Returns:
- A Object of the type of obj.
- Throws:
HDF5Exception- - Error unsupported type.
-
-