Mega Code Archive

 
Categories / Java / Data Type
 

Decode a Base64 encoded binary

import org.apache.commons.codec.binary.Base64; import java.util.Arrays; public class Main {   public static void main(String[] args) {     String hello = "aaaaaaaa";     byte[] decoded = Base64.decodeBase64(hello.getBytes());     System.out.println(Arrays.toString(decoded));     String decodedString = new String(decoded);     System.out.println(hello + " = " + decodedString);   } }