Skip to content

Instantly share code, notes, and snippets.

@zubayerahamed
Created May 8, 2018 08:58
Show Gist options
  • Save zubayerahamed/b05b9acc3c4a1f0557f285371aaee24b to your computer and use it in GitHub Desktop.
Save zubayerahamed/b05b9acc3c4a1f0557f285371aaee24b to your computer and use it in GitHub Desktop.
Base64 Encoding in Java
import org.apache.commons.codec.binary.Base64;
byte[] encodedBytes = Base64.encodeBase64("Test".getBytes());
System.out.println("encodedBytes " + new String(encodedBytes));
byte[] decodedBytes = Base64.decodeBase64(encodedBytes);
System.out.println("decodedBytes " + new String(decodedBytes));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment