fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String imageData = "data:image/jpeg;base64,SGVsbG8sIHdvcmxkIQ==";
  10. imageData = imageData.replaceFirst("^data:image/[^;]*;base64,?","");
  11. byte[] bytes = javax.xml.bind.DatatypeConverter.parseBase64Binary(imageData);
  12. System.out.println(new String(bytes));
  13. }
  14. }
Success #stdin #stdout 0.08s 380672KB
stdin
Standard input is empty
stdout
Hello, world!