FOCUS Software Engineering has a new name: proconX - Professional Fieldbus Connections   

Converter Class Reference

List of all members.

Detailed Description

Conversion Routines.

Utility class which provides functions to convert between different binary data repesentations.


Public Member Functions

 Converter (boolean swapMode)
 Creates a Converter object.

void floatsToShorts (float[] floatArr, short[] shortArr)
 Binary conversion from a float array to a short array.

void intsToShorts (int[] intArr, short[] shortArr)
 Binary conversion from a int array to a short array.

void shortsToInts (short[] shortArr, int[] intArr)
 Binary conversion from a short array to a int array.

void shortsToFloats (short[] shortArr, float[] floatArr)
 Binary conversion from a short array to a float array.


Static Public Attributes

final boolean BIG_ENDIAN = false
 Big endian conversion.

final boolean LITTLE_ENDIAN = true
 Little endian conv.


Constructor & Destructor Documentation

Converter boolean  swapMode  ) 
 

Creates a Converter object.

Parameters:
swapMode BIG_ENDIAN: most significant word is the 0th element, LITTLE_ENDIAN: least significant word is the 0th element.


Member Function Documentation

void floatsToShorts float[]  floatArr,
short[]  shortArr
 

Binary conversion from a float array to a short array.

Note:
The short array must be twice as large as the float array!
Exceptions:
ArrayStoreException Array size mismatch

void intsToShorts int[]  intArr,
short[]  shortArr
 

Binary conversion from a int array to a short array.

Note:
The short array must be twice as large as the int array!
Exceptions:
ArrayStoreException Array size mismatch

void shortsToInts short[]  shortArr,
int[]  intArr
 

Binary conversion from a short array to a int array.

Note:
The short array must be twice as large as the int array!
Exceptions:
ArrayStoreException Array size mismatch

void shortsToFloats short[]  shortArr,
float[]  floatArr
 

Binary conversion from a short array to a float array.

Note:
The short array must be twice as large as the float array!
Exceptions:
ArrayStoreException Array size mismatch

   Back | Top of page Info | Support | Contact | About   
Information in this document is subject to change without notice. Copyright © 2000-2007 proconX Pty Ltd. All rights reserved.
All product and brand names mentioned on this page may be trademarks or registered trademarks of their respective owners.