[Bluetooth] re-fix ArrayStoreException (#15891)

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2023-11-13 19:39:39 +01:00 committed by GitHub
parent beade55ca6
commit 2b393699bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
} }