Package org.apache.derby.client.am
Class FloatingPoint
java.lang.Object
org.apache.derby.client.am.FloatingPoint
Converters from floating point bytes to Java
float
, double
, or
java.math.BigDecimal
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Supported Unix Big Endian IEEE 754 floating point representation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static final int
convertFromByteToInt
(byte[] buffer, int offset) Convert the byte array to an int.private static final long
convertFromByteToLong
(byte[] buffer, int offset) Convert the byte array to a long.(package private) static double
getDouble
(byte[] buffer, int offset) Build a Java double from an 8-byte floating point representation.(package private) static float
getFloat
(byte[] buffer, int offset) Build a Java float from a 4-byte floating point representation.
-
Field Details
-
IEEE_754_FLOATING_POINT
public static final int IEEE_754_FLOATING_POINTSupported Unix Big Endian IEEE 754 floating point representation.- See Also:
-
-
Constructor Details
-
FloatingPoint
private FloatingPoint()
-
-
Method Details
-
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:
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:
IllegalArgumentException
- if the specified representation is not recognized.
-