org.apache.derby.client.am
Class FloatingPoint

java.lang.Object
  extended by org.apache.derby.client.am.FloatingPoint

public class FloatingPoint
extends java.lang.Object

Converters from floating point bytes to Java float, double, or java.math.BigDecimal.


Field Summary
static int IEEE_754_FLOATING_POINT
          Supported Unix Big Endian IEEE 754 floating point representation.
 
Constructor Summary
private FloatingPoint()
           
 
Method Summary
private static int convertFromByteToInt(byte[] buffer, int offset)
          Convert the byte array to an int.
private static long convertFromByteToLong(byte[] buffer, int offset)
          Convert the byte array to a long.
static void doubleToIeee754Bytes(byte[] buffer, int offset, double d)
          Write a Java double to an 8-byte double precision floating point representation.
static void floatToIeee754Bytes(byte[] buffer, int offset, float f)
          Write a Java float to a 4-byte floating point representation.
static double getDouble(byte[] buffer, int offset)
          Build a Java double from an 8-byte floating point representation.
static float getFloat(byte[] buffer, int offset)
          Build a Java float from a 4-byte floating point representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Constructor Detail

FloatingPoint

private FloatingPoint()
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

public static final float getFloat(byte[] buffer,
                                   int offset)
Build a Java float from a 4-byte floating point representation.

This includes DERBY types:

Throws:
java.lang.IllegalArgumentException - if the specified representation is not recognized.

getDouble

public static final double getDouble(byte[] buffer,
                                     int offset)
Build a Java double from an 8-byte floating point representation.

This includes DERBY types:

Throws:
java.lang.IllegalArgumentException - if the specified representation is not recognized.

floatToIeee754Bytes

public static final void floatToIeee754Bytes(byte[] buffer,
                                             int offset,
                                             float f)
Write a Java float to a 4-byte floating point representation.


doubleToIeee754Bytes

public static final void doubleToIeee754Bytes(byte[] buffer,
                                              int offset,
                                              double d)
Write a Java double to an 8-byte double precision floating point representation.


Built on Thu 2010-12-23 20:49:13+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.