Package org.apache.derby.client.am
Class FloatingPoint
- java.lang.Object
-
- org.apache.derby.client.am.FloatingPoint
-
public class FloatingPoint extends java.lang.ObjectConverters from floating point bytes to Javafloat,double, orjava.math.BigDecimal.
-
-
Field Summary
Fields Modifier and Type Field Description static intIEEE_754_FLOATING_POINTSupported Unix Big Endian IEEE 754 floating point representation.
-
Constructor Summary
Constructors Modifier Constructor Description privateFloatingPoint()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static intconvertFromByteToInt(byte[] buffer, int offset)Convert the byte array to an int.private static longconvertFromByteToLong(byte[] buffer, int offset)Convert the byte array to a long.(package private) static doublegetDouble(byte[] buffer, int offset)Build a Java double from an 8-byte floating point representation.(package private) static floatgetFloat(byte[] buffer, int offset)Build a Java float from a 4-byte floating point representation.
-
-
-
Field Detail
-
IEEE_754_FLOATING_POINT
public static final int IEEE_754_FLOATING_POINT
Supported Unix Big Endian IEEE 754 floating point representation.- See Also:
- Constant Field Values
-
-
Method Detail
-
convertFromByteToInt
private static final int convertFromByteToInt(byte[] buffer, int offset)Convert the byte array to an int.
-
convertFromByteToLong
private static final long convertFromByteToLong(byte[] buffer, int offset)Convert the byte array to a long.
-
getFloat
static float getFloat(byte[] buffer, int offset)Build a Java float from a 4-byte floating point representation.
This includes DERBY types:
- REAL
- FLOAT(1<=n<=24)
- Throws:
java.lang.IllegalArgumentException- if the specified representation is not recognized.
-
getDouble
static double getDouble(byte[] buffer, int offset)Build a Java double from an 8-byte floating point representation. This includes DERBY types:- FLOAT
- DOUBLE [PRECISION]
- Throws:
java.lang.IllegalArgumentException- if the specified representation is not recognized.
-
-