Java tutorial
//package com.java2s; //License from project: Apache License import android.util.Base64; public class Main { static public byte[] decodeToByte(String code) { if (code == null || code.length() == 0) { return null; } return Base64.decode(code.getBytes(), Base64.NO_WRAP); } static public byte[] decodeToByte(byte[] code) { if (code == null || code.length == 0) { return null; } return Base64.decode(code, Base64.NO_WRAP); } }