public class TLcdByteConverter extends Object
Constructor and Description |
---|
TLcdByteConverter() |
Modifier and Type | Method and Description |
---|---|
static void |
doubleToEightByteSFCT(double aDouble,
byte[] aDestinationSFCT,
int aStart)
Converts a double to four bytes.
|
static double |
eightBytesToDouble(byte[] aByteArray,
int aStart)
Converts eight bytes to a double.
|
static double |
eightBytesToDouble(byte b1,
byte b2,
byte b3,
byte b4,
byte b5,
byte b6,
byte b7,
byte b8)
Converts eight bytes to a double.
|
static void |
floatToFourByteSFCT(float aFloat,
byte[] aDestinationSFCT,
int aStart)
Converts a float to four bytes.
|
static double |
fourBytesToDouble(byte b1,
byte b2,
byte b3,
byte b4)
Converts four bytes to a double.
|
static float |
fourBytesToFloat(byte b1,
byte b2,
byte b3,
byte b4)
Converts four bytes to a float.
|
static int |
fourBytesToInt(byte[] aByteArray,
int aStart)
Converts four bytes to an integer.
|
static int |
fourBytesToInt(byte b1,
byte b2,
byte b3,
byte b4)
Converts four bytes to an integer.
|
static void |
intToFourByteSFCT(int aInt,
byte[] aDestinationSFCT,
int aStart)
Converts an integer to four bytes.
|
static void |
shortToTwoByteSFCT(short aShort,
byte[] aDestinationSFCT,
int aStart)
Converts a short to two bytes.
|
static short |
twoBytesToShort(byte b1,
byte b2)
Converts two bytes to a short.
|
public static void shortToTwoByteSFCT(short aShort, byte[] aDestinationSFCT, int aStart)
aShort
- the short to be converted.aDestinationSFCT
- the byte array in which the resulting bytes will be written,
with the first byte placed at aStart
.aStart
- the index for the first output byte.public static void intToFourByteSFCT(int aInt, byte[] aDestinationSFCT, int aStart)
aInt
- the integer to be converted.aDestinationSFCT
- the byte array in which the resulting bytes will be written,
with the first byte placed at aStart
.aStart
- the index for the first output byte.public static void floatToFourByteSFCT(float aFloat, byte[] aDestinationSFCT, int aStart)
aFloat
- the float to be converted.aDestinationSFCT
- the byte array in which the resulting bytes will be written,
with the first byte placed at aStart
.aStart
- the index for the first output byte.public static void doubleToEightByteSFCT(double aDouble, byte[] aDestinationSFCT, int aStart)
aDouble
- the double to be converted.aDestinationSFCT
- the byte array in which the resulting bytes will be written,
with the first byte placed at aStart
.aStart
- the index for the first output byte.public static short twoBytesToShort(byte b1, byte b2)
b1
- the first byte.b2
- the second byte.public static int fourBytesToInt(byte[] aByteArray, int aStart)
aByteArray
- the byte array from which the bytes are retrieved,
with the first byte starting at aStart
.aStart
- the index for the first input byte.public static int fourBytesToInt(byte b1, byte b2, byte b3, byte b4)
b1
- the first byte.b2
- the second byte.b3
- the third byte.b4
- the fourth byte.public static float fourBytesToFloat(byte b1, byte b2, byte b3, byte b4)
b1
- the first byte.b2
- the second byte.b3
- the third byte.b4
- the fourth byte.public static double fourBytesToDouble(byte b1, byte b2, byte b3, byte b4)
b1
- the first byte.b2
- the second byte.b3
- the third byte.b4
- the fourth byte.public static double eightBytesToDouble(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8)
b1
- through b8: the eight consecutive bytes.public static double eightBytesToDouble(byte[] aByteArray, int aStart)
aByteArray
- the byte array from which the bytes are retrieved,
with the first byte starting at aStart
.aStart
- the index for the first input byte.