Converting int to byte in Android

前端 未结 4 1075
囚心锁ツ
囚心锁ツ 2020-12-21 07:49

Actually I need to transfer the integer value along with the bitmap via bluetooth.. Now my problem is I need to transfer the in

4条回答
  •  情深已故
    2020-12-21 08:17

    for 0-255 numbers.

    int i = 200; // your int variable
    byte b = (byte)(i & 0xFF);
    

提交回复
热议问题