[Bluetooth] re-fix ArrayStoreException (#15891)

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
pull/16029/head
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
1 changed files with 4 additions and 1 deletions

View File

@ -47,7 +47,10 @@ public class BluetoothUtils {
*/
public static int[] toIntArray(byte[] value) {
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;
}