-1

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

xav
  • 5,452
  • 7
  • 48
  • 57
TomM12
  • 55
  • 1
  • 8

1 Answers1

0

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);
xav
  • 5,452
  • 7
  • 48
  • 57