This question is very close to Bit array to Byte array in JAVA, I want to convert the following bit array to a byte array?
int[] bits = {1, 0, 1, 0, 1, 1, 0, 1, 0, 1};
But different to the answer is the relevant question, I want to store the result big-endian which should be:
0xB5 0x02
How I suppose to do this? Thanks!