fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.math.BigInteger;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main(String[] argv) throws Exception {
  12. byte[] bytes = new byte[] { 46, 54, 87, 36, 121, 1, 45, 41 };
  13.  
  14. // Create a BigInteger using the byte array
  15. BigInteger bi = new BigInteger(bytes);
  16.  
  17. String s = bi.toString(2);
  18. System.out.println(s);
  19.  
  20. }
  21. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
10111000110110010101110010010001111001000000010010110100101001