fork(18) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. int[] ints = { 233, 154, 24, 196, 40, 203, 56, 213, 242, 96, 133, 54, 120, 146, 46, 3 };
  13. System.out.println(convertToBase64(ints));
  14. }
  15.  
  16. public static String convertToBase64(int[] ints) {
  17. byte[] bytes = new byte[ints.length];
  18. for (int i = 0; i < ints.length; i++) {
  19. bytes[i] = (byte)ints[i];
  20. }
  21. return Base64.getEncoder().encodeToString(bytes);
  22. }
  23. }
Success #stdin #stdout 0.06s 2841600KB
stdin
Standard input is empty
stdout
6ZoYxCjLONXyYIU2eJIuAw==