public class FloatingPoint extends DataType implements OrderedDataType
Constructor and Description |
---|
FloatingPoint(java.nio.ByteBuffer bb) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
fillData(java.nio.ByteBuffer buffer,
int[] dimensions,
HdfBackingStorage hdfBackingStorage)
Fill the data from buffer into the returned
Object using this DataType |
short |
getBitOffset() |
short |
getBitPrecision() |
java.nio.ByteOrder |
getByteOrder() |
int |
getExponentBias() |
byte |
getExponentLocation() |
byte |
getExponentSize() |
java.lang.Class<?> |
getJavaType()
Get the Java
Class of this HDF5 type |
byte |
getMantissaLocation() |
int |
getMantissaNormalization() |
byte |
getMantissaSize() |
int |
getSignLocation() |
boolean |
isHighPadding() |
boolean |
isInternalPadding() |
boolean |
isLowPadding() |
static float |
toFloat(short element)
This method converts 2 bytes (represented as a short) into a half precision float (represented by the java full
precision float).
|
getDataClass, getSize, getVersion, readDataType
public java.nio.ByteOrder getByteOrder()
getByteOrder
in interface OrderedDataType
public boolean isLowPadding()
public boolean isHighPadding()
public boolean isInternalPadding()
public int getMantissaNormalization()
public int getSignLocation()
public short getBitOffset()
public short getBitPrecision()
public byte getExponentLocation()
public byte getExponentSize()
public byte getMantissaLocation()
public byte getMantissaSize()
public int getExponentBias()
public java.lang.Class<?> getJavaType()
DataType
Class
of this HDF5 typegetJavaType
in class DataType
Class
of this HDF5 typepublic java.lang.Object fillData(java.nio.ByteBuffer buffer, int[] dimensions, HdfBackingStorage hdfBackingStorage)
DataType
Object
using this DataType
public static float toFloat(short element)
The method used is described here https://stackoverflow.com/a/6162687/4653517
element
- the 2 byte short to convert to a half precision float