public final class ConversionUtils
extends java.lang.Object
| Modifier and Type | Method and Description | 
|---|---|
| static int | asInt(byte value)Converts byte to integer value. | 
| static int | asInt(byte[] input)Converts array into integer value. | 
| static byte[] | convert(java.io.File file)Converts File to bytes of array. | 
| static byte[] | convert(java.util.UUID uuid)Converts UUID ( UUID) to bytes array. | 
| static byte[] | convertPowerLevel(int powerLevel)Converts power level to bytes array which can be accepted by Beacon. | 
| static boolean | doesArrayBeginWith(byte[] array,
                  byte[] prefix)checkes whether array starts with the byte sequence specified in prefix array. | 
| static boolean | doesArrayContainSubset(byte[] src,
                      byte[] subset,
                      int startIndex) | 
| static byte[] | extractPayload(byte[] src,
              int start,
              int length) | 
| static byte[] | invert(byte[] array)Inverts bytes array. | 
| static byte[] | to2ByteArray(int value)Converts integer value to 2-byte array. | 
| static int | toPowerLevel(byte[] byteValue)Converts bytes array to Beacon power level. | 
| static int | toPowerLevel(int value)Converts integer value to power level. | 
| static double[] | toPrimitive(java.lang.Double[] array)Converts an array of object Doubles to primitives. | 
| static java.util.UUID | toUUID(byte[] uuid)Converts bytes array to UUID | 
public static int asInt(byte value)
value - the valuepublic static byte[] extractPayload(byte[] src,
                                    int start,
                                    int length)
public static boolean doesArrayBeginWith(byte[] array,
                                         byte[] prefix)
array - the arrayprefix - the prefix arraypublic static byte[] invert(byte[] array)
array - the arraypublic static int asInt(byte[] input)
input - the input arraypublic static byte[] to2ByteArray(int value)
value - the valuepublic static byte[] convert(java.util.UUID uuid)
UUID) to bytes array.uuid - the uuidpublic static byte[] convert(java.io.File file)
                      throws java.io.IOException
file - the filejava.io.IOException - the iO exceptionpublic static int toPowerLevel(byte[] byteValue)
byteValue - the byte valuepublic static int toPowerLevel(int value)
value - the valuepublic static byte[] convertPowerLevel(int powerLevel)
powerLevel - the power levelpublic static java.util.UUID toUUID(byte[] uuid)
uuid - the byte arraypublic static boolean doesArrayContainSubset(byte[] src,
                                             byte[] subset,
                                             int startIndex)
public static double[] toPrimitive(java.lang.Double[] array)
Converts an array of object Doubles to primitives.
This method returns null for a null input array.
array - a Double array, may be nulldouble array, null if null array inputjava.lang.NullPointerException - if array content is null