[Bluetooth] re-fix ArrayStoreException (#15891)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
parent
beade55ca6
commit
2b393699bf
@ -47,7 +47,10 @@ public class BluetoothUtils {
|
|||||||
*/
|
*/
|
||||||
public static int[] toIntArray(byte[] value) {
|
public static int[] toIntArray(byte[] value) {
|
||||||
int[] ret = new int[value.length];
|
int[] ret = new int[value.length];
|
||||||
System.arraycopy(value, 0, ret, 0, value.length);
|
// System.arraycopy cannot be used as it throws ArrayStoreException
|
||||||
|
for (int i = 0; i < value.length; i++) {
|
||||||
|
ret[i] = value[i];
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user