There is an array of data {0xFE, 0x00, 0x11, 0x08} that needs to be sent to the bluetooth device, but the device accepts data for recording only in the form of byte []. How to properly convert an int array to byte in this situation?
- And what's the problem - int is occupied by more than one byte? - MBo
- @MBo yes, 0xFE is already 254, while byte has a maximum of 127 - kalugin1912
- @ kalugin1912, byte can store a range from -128 to 127. As an option, you can make it unsigned using Byte.toUnsignedInt (byte value). - UjinUkr
- @ kalugin1912 0xFE - one byte (with a negative value) - MBo
|