All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.access.BinaryConverter

java.lang.Object
   |
   +----com.ibm.as400.access.BinaryConverter

public class BinaryConverter
extends Object
A binary types converter between Java byte arrays and Java simple types.


Method Index

 o byteArrayToDouble(byte[], int)
Convert the specified AS/400 data type to a double.
 o byteArrayToFloat(byte[], int)
Convert the specified AS/400 data type to a float.
 o byteArrayToInt(byte[], int)
Convert the specified AS/400 data type to an int.
 o byteArrayToLong(byte[], int)
Convert the specified AS/400 data type to a long.
 o byteArrayToShort(byte[], int)
Convert the specified AS/400 data type to a short.
 o byteArrayToUnsignedInt(byte[], int)
Convert the specified AS/400 data type to a long.
 o byteArrayToUnsignedShort(byte[], int)
Convert the specified AS/400 data type to an int.
 o doubleToByteArray(double, byte[], int)
Convert the specified double into AS/400 format in the specified byte array.
 o floatToByteArray(float, byte[], int)
Convert the specified float into AS/400 format in the specified byte array.
 o intToByteArray(int, byte[], int)
Convert the specified int into AS/400 format in the specified byte array.
 o longToByteArray(long, byte[], int)
Convert the specified long into AS/400 format in the specified byte array.
 o shortToByteArray(short, byte[], int)
Convert the specified short into AS/400 format in the specified byte array.
 o unsignedIntToByteArray(long, byte[], int)
Convert the specified long into AS/400 format in the specified byte array.
 o unsignedShortToByteArray(int, byte[], int)
Convert the specified int into AS/400 format in the specified byte array.

Methods

 o shortToByteArray
 public static void shortToByteArray(short shortValue,
                                     byte as400Value[],
                                     int offset)
Convert the specified short into AS/400 format in the specified byte array.

Parameters:
shortValue - the value to be converted to AS/400 format.
as400Value - the array to receive the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
 o byteArrayToShort
 public static short byteArrayToShort(byte as400Value[],
                                      int offset)
Convert the specified AS/400 data type to a short.

Parameters:
as400Value - the array containing the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
Returns:
a short corresponding to the data type.
 o intToByteArray
 public static void intToByteArray(int intValue,
                                   byte as400Value[],
                                   int offset)
Convert the specified int into AS/400 format in the specified byte array.

Parameters:
intValue - the value to be converted to AS/400 format.
as400Value - the array to receive the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
 o byteArrayToInt
 public static int byteArrayToInt(byte as400Value[],
                                  int offset)
Convert the specified AS/400 data type to an int.

Parameters:
as400Value - the array containing the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
Returns:
an int corresponding to the data type.
 o floatToByteArray
 public static void floatToByteArray(float floatValue,
                                     byte as400Value[],
                                     int offset)
Convert the specified float into AS/400 format in the specified byte array.

Parameters:
floatValue - the value to be converted to AS/400 format.
as400Value - the array to receive the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
 o byteArrayToFloat
 public static float byteArrayToFloat(byte as400Value[],
                                      int offset)
Convert the specified AS/400 data type to a float.

Parameters:
as400Value - the array containing the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
Returns:
a float corresponding to the data type.
 o doubleToByteArray
 public static void doubleToByteArray(double doubleValue,
                                      byte as400Value[],
                                      int offset)
Convert the specified double into AS/400 format in the specified byte array.

Parameters:
doubleValue - the value to be converted to AS/400 format.
as400Value - the array to receive the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
 o byteArrayToDouble
 public static double byteArrayToDouble(byte as400Value[],
                                        int offset)
Convert the specified AS/400 data type to a double.

Parameters:
as400Value - the array containing the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
Returns:
a double corresponding to the data type.
 o unsignedShortToByteArray
 public static void unsignedShortToByteArray(int intValue,
                                             byte as400Value[],
                                             int offset)
Convert the specified int into AS/400 format in the specified byte array.

Parameters:
intValue - the value to be converted to AS/400 format. The integer should be greater than or equal to zero and representable in two bytes.
as400Value - the array to receive the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
 o byteArrayToUnsignedShort
 public static int byteArrayToUnsignedShort(byte as400Value[],
                                            int offset)
Convert the specified AS/400 data type to an int.

Parameters:
as400Value - the array containing the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
Returns:
an int corresponding to the data type.
 o unsignedIntToByteArray
 public static void unsignedIntToByteArray(long longValue,
                                           byte as400Value[],
                                           int offset)
Convert the specified long into AS/400 format in the specified byte array.

Parameters:
longValue - the value to be converted to AS/400 format. The long should be greater than or equal to zero and representable in four bytes.
as400Value - the array to receive the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
 o byteArrayToUnsignedInt
 public static long byteArrayToUnsignedInt(byte as400Value[],
                                           int offset)
Convert the specified AS/400 data type to a long.

Parameters:
as400Value - the array containing the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
Returns:
a long corresponding to the data type.
 o longToByteArray
 public static void longToByteArray(long longValue,
                                    byte as400Value[],
                                    int offset)
Convert the specified long into AS/400 format in the specified byte array.

Parameters:
longValue - the value to be converted to AS/400 format.
as400Value - the array to receive the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
 o byteArrayToLong
 public static long byteArrayToLong(byte as400Value[],
                                    int offset)
Convert the specified AS/400 data type to a long.

Parameters:
as400Value - the array containing the data type in AS/400 format.
offset - the offset into the byte array for the start of the AS/400 value.
Returns:
a long corresponding to the data type.

All Packages  Class Hierarchy  This Package  Previous  Next  Index