Say I have an integer number: 11728322732
how can i convert it to a string according to its byte representation, i.e 11100011000000001100000111110001
(32 bits \ 4 bytes \ integer)
Thanks
Say I have an integer number: 11728322732
how can i convert it to a string according to its byte representation, i.e 11100011000000001100000111110001
(32 bits \ 4 bytes \ integer)
Thanks
Here it is:
Long.toBinaryString(11728322732L);
Actually, 11728322732
is not an Integer
but a Long
(because it is greater than Integer.MAX_VALUE
). So if you really want to convert this long to a 32-bits int (can't figure why actually), you could do:
Integer.toBinaryString((int)11728322732L);