• Libraries
  • Shop
  • Doc
  • Free Modbus
  • Support
  • Login
  • Introduction
  • Chapters
  • Modules
  • Classes
  • Class List
  • Class Members
  • com
  • focus_sw
  • fieldtalk
  • Converter
Public Member Functions | Static Public Attributes

Converter Class Reference

Conversion Routines. More...

List of all members.

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

static final boolean BIG_ENDIAN = false
 Big endian conversion.
static final boolean LITTLE_ENDIAN = true
 Little endian conv.

Detailed Description

Conversion Routines.

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


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

FieldTalk Modbus Master Library, Java Edition
Library version 2.6.5
Speak to the Experts
Modbus Organization Member logo

We are member of the Modbus Organization, Inc.

Buy with Confidence
30-day money back guarantee All our FieldTalk web sales are backed by a 30-day Money Back Guarantee.
We Accept
Bank VISA MasterCard PayPal
Customer Info
  • Info & Contact
  • Customer Login
  • Terms of Service
  • Terms of Sale
  • Privacy Policy
© 2005-2025 proconX Pty Ltd. All rights reserved. proconX and FieldTalk are trademarks of proconX Pty Ltd.
All other trademarks and registered trademarks appearing on www.modbusdriver.com are the property of their respective owners.