Can now parse IBeacon Manufacturer data (need to flip the byte order of

a few fields)
This commit is contained in:
Alexandros Schillings
2014-03-11 12:57:39 +00:00
parent 39d7b9a882
commit 78c04568de
2 changed files with 20 additions and 12 deletions
@@ -31,6 +31,17 @@ public class ByteUtils {
return sb.toString();
}
public static int getIntFrom2ByteArray(byte[] input){
final byte[] result = new byte[4];
result[0] = 0;
result[1] = 0;
result[2] = input[0];
result[3] = input[1];
return ByteUtils.getIntFromByteArray(result);
}
/**
* Converts a byte to an int, preserving the sign.
*
@@ -53,6 +64,7 @@ public class ByteUtils {
return ByteBuffer.wrap(bytes).getInt();
}
/**
* Converts a byte array to a long;
*