List of usage examples for android.util Base64 DEFAULT
int DEFAULT
To view the source code for android.util Base64 DEFAULT.
Click Source Link
From source file:Main.java
public static String base64decode(String base64) { String decoded = ""; try {//from ww w .j a va 2s . com decoded = new String(Base64.decode(base64, Base64.DEFAULT), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return decoded; }
From source file:Main.java
public static byte[] decodeToByte(String content) { if (TextUtils.isEmpty(content)) { return null; }//w w w . java 2 s. co m return Base64.decode(content.getBytes(), Base64.DEFAULT); }
From source file:Main.java
public static String decode(String decodecon) { if (TextUtils.isEmpty(decodecon)) { return ""; }//from w ww . j ava 2s .c o m return new String(Base64.decode(decodecon, Base64.DEFAULT)); }
From source file:Main.java
public static String base64Decode(String str, String code) throws UnsupportedEncodingException { String string = new String(Base64.decode(str.getBytes(code), Base64.DEFAULT)); return string; }
From source file:Main.java
public static Bitmap decodeToBitmap(String encoded) { byte[] bytes = Base64.decode(encoded, Base64.DEFAULT); return BitmapFactory.decodeByteArray(bytes, 0, bytes.length); }
From source file:Main.java
public static Bitmap string2Bitmap(String imageData) { Bitmap bitmap = null;//w w w .j a v a 2s. co m byte[] decode = Base64.decode(imageData, Base64.DEFAULT); bitmap = BitmapFactory.decodeByteArray(decode, 0, decode.length); return bitmap; }
From source file:Main.java
/** * @param s/*from w ww .j a v a2s . c o m*/ * @return */ public static Bitmap base642bitmap(String s) { byte[] bytes = Base64.decode(s, Base64.DEFAULT); return BitmapFactory.decodeByteArray(bytes, 0, bytes.length); }
From source file:Main.java
public final static Bitmap stringToBitmap(String in) { if (in == "") return null; byte[] bytes = Base64.decode(in, Base64.DEFAULT); return BitmapFactory.decodeByteArray(bytes, 0, bytes.length); }
From source file:Main.java
/** * Converts byte array to String//from ww w . java 2 s. c om * @param arr - The array to be encoded * @return - The returned String */ public static String encode(byte[] arr) { return Base64.encodeToString(arr, Base64.DEFAULT); }
From source file:Main.java
public static String base64Encode(String strBase64, String code) throws UnsupportedEncodingException { String enToStr = Base64.encodeToString(strBase64.getBytes(), Base64.DEFAULT); // String string = new String(Base64.encode(strBase64.getBytes(code), Base64.DEFAULT)); return enToStr; }