I have a decimal number and I would convert it in an array buffer of byte (little endian notation).
I try this but I am not sure it is working:
ByteBuffer a = ByteBuffer.allocate(4);
a.putInt( (int) number);
return a.array();
If number is 125 I have returned:
[0,0,0,128];
Is it correct? I think that the correct conversion would be:
[0,0,0,10000000]
How can I do with Java?
Thanks in advance